@Test public void testRequals() { assertEquals(true, StringUtil.requals("1", "1 ,5,7,9,10,13,14")); assertEquals(true, StringUtil.requals("7", "1,5, 7 ,9,10,13,14")); assertEquals(true, StringUtil.requals("9", "1,5,7,9,10,13,14")); assertEquals(false, StringUtil.requals("15", "1,5,7,9,10,13,14")); assertEquals(true, StringUtil.requals("15", "15|7|9|10|13|14", "\\|")); }
public static boolean requals(String str1, String str2) { if (str1 != null && str2 != null) { str2 = str2.replaceAll("\\s*", ""); String[] arr = str2.split(","); for (String t : arr) { if (t.equals(str1.trim())) { return true; } } } return false; }
StringUtil { public static boolean requals(String str1, String str2) { if (str1 != null && str2 != null) { str2 = str2.replaceAll("\\s*", ""); String[] arr = str2.split(","); for (String t : arr) { if (t.equals(str1.trim())) { return true; } } } return false; } }
StringUtil { public static boolean requals(String str1, String str2) { if (str1 != null && str2 != null) { str2 = str2.replaceAll("\\s*", ""); String[] arr = str2.split(","); for (String t : arr) { if (t.equals(str1.trim())) { return true; } } } return false; }  }
StringUtil { public static boolean requals(String str1, String str2) { if (str1 != null && str2 != null) { str2 = str2.replaceAll("\\s*", ""); String[] arr = str2.split(","); for (String t : arr) { if (t.equals(str1.trim())) { return true; } } } return false; }  static boolean isEmpty(String str); static String joinString(List list, String symbol); static boolean requals(String str1, String str2); static boolean requals(String str1, String str2, String split); static String subStringOmit(String subject, int size); static String subStringSymbol(String str, int len, String symbol); static String joinString(String[] array, String symbol); static String join(String linkStr, String... strs); static String getHideEmailPrefix(String email); static String repeat(String src, int num); static String ltrim(String str1, int num); static String rtrim(String str, int num); static List<String> parseString2List(String src, String pattern); static String formatDouble(double f, String format); static String left(String input, int count); static String right(String input, int count); static String full2Half(String str); static String Half2Full(String str); static String replaceBlank(String str); static boolean isIn(String substring, String[] source); static String string2Unicode(String string); static String unicode2String(String unicode); static String trimPunct(String str); static double SimilarityRatio(String str1, String str2); static double SimilarDegree(String str1, String str2); static int countSubStr(String string, String str); static String replaceFirst(String s, String sub, String with); static String replaceLast(String s, String sub, String with); static String remove(String s, String sub); static String upperFirstChar(String str); static String lowerFirstChar(String str); static boolean rigthEquals(String str1, String str2, int length); static boolean leftEquals(String str1, String str2, int length); }
StringUtil { public static boolean requals(String str1, String str2) { if (str1 != null && str2 != null) { str2 = str2.replaceAll("\\s*", ""); String[] arr = str2.split(","); for (String t : arr) { if (t.equals(str1.trim())) { return true; } } } return false; }  static boolean isEmpty(String str); static String joinString(List list, String symbol); static boolean requals(String str1, String str2); static boolean requals(String str1, String str2, String split); static String subStringOmit(String subject, int size); static String subStringSymbol(String str, int len, String symbol); static String joinString(String[] array, String symbol); static String join(String linkStr, String... strs); static String getHideEmailPrefix(String email); static String repeat(String src, int num); static String ltrim(String str1, int num); static String rtrim(String str, int num); static List<String> parseString2List(String src, String pattern); static String formatDouble(double f, String format); static String left(String input, int count); static String right(String input, int count); static String full2Half(String str); static String Half2Full(String str); static String replaceBlank(String str); static boolean isIn(String substring, String[] source); static String string2Unicode(String string); static String unicode2String(String unicode); static String trimPunct(String str); static double SimilarityRatio(String str1, String str2); static double SimilarDegree(String str1, String str2); static int countSubStr(String string, String str); static String replaceFirst(String s, String sub, String with); static String replaceLast(String s, String sub, String with); static String remove(String s, String sub); static String upperFirstChar(String str); static String lowerFirstChar(String str); static boolean rigthEquals(String str1, String str2, int length); static boolean leftEquals(String str1, String str2, int length);  }