| 1234567891011121314151617181920 |
- package cn.ftebox.util;
- public class StringUtil {
- /**
- * 在字符串前后加%
- */
- public static String formatLike(String str) {
- if (isNotEmpty(str)){
- return "%"+str+"%";
- }
- return null;
- }
- /**
- * 判断字符串是否为空
- */
- private static boolean isNotEmpty(String str) {
- return str != null && !"".equals(str.trim());
- }
- }
|