@Test public void trim() throws Exception { assertEquals(null, StringUtils.trim(null)); assertEquals("", StringUtils.trim("")); assertEquals("", StringUtils.trim(" ")); assertEquals("sxp", StringUtils.trim("sxp")); assertEquals("施小平", StringUtils.trim("施小平")); assertEquals("x小p", StringUtils.trim("x小p")); assertEquals("sxp", StringUtils.trim(" sxp")); assertEquals("施小平", StringUtils.trim(" 施小平 ")); assertEquals("x 小 p", StringUtils.trim("x 小 p")); }
public static String trim(String source) { if (isEmpty(source)) { return source; } return source.trim(); }
StringUtils { public static String trim(String source) { if (isEmpty(source)) { return source; } return source.trim(); } }
StringUtils { public static String trim(String source) { if (isEmpty(source)) { return source; } return source.trim(); }  }
StringUtils { public static String trim(String source) { if (isEmpty(source)) { return source; } return source.trim(); }  static boolean isEmpty(String str); static boolean isNotEmpty(String str); static boolean hasText(String str); static boolean hasText(CharSequence str); static boolean hasChineseCharacter(String str); static String trim(String source); }
StringUtils { public static String trim(String source) { if (isEmpty(source)) { return source; } return source.trim(); }  static boolean isEmpty(String str); static boolean isNotEmpty(String str); static boolean hasText(String str); static boolean hasText(CharSequence str); static boolean hasChineseCharacter(String str); static String trim(String source);  }