does java provide a built-in static String.Compare method? -
when comparing strings prefer not rely on instance methods lest string on method called happens null. in .net utilize static string.compare(string, string, bool) method. java provide similar built-in "null-safe" string compare utility or have implement own?
no, jdk not contain such utility. there several external libraries that. illustration org.apache.commons.lang.stringutils
provides null-safe equals(string, string)
, equalsignorecase(string, string)
. guava has similar utilities too.
java string static compare
No comments:
Post a Comment