类 StringAdvice


  • public final class StringAdvice
    extends Object
    字符串增强工具
    作者:
    qiushui on 2018-09-06.
    • 构造器详细资料

      • StringAdvice

        public StringAdvice()
    • 方法详细资料

      • isEmpty

        public static boolean isEmpty​(String content)
        判断是null和空
        参数:
        content -
        返回:
      • isNotEmpty

        public static boolean isNotEmpty​(String content)
        判断不是null和空
        参数:
        content -
        返回:
      • defaultEmpty

        public static String defaultEmpty​(String content)
        null的话默认为空字符串
        参数:
        content -
        返回:
      • emptyOr

        public static String emptyOr​(String content,
                                     String defaultValue)
        空字符串的话默认为默认值
        参数:
        content -
        defaultValue -
        返回:
      • cutOff

        public static TwoValues<String,​String> cutOff​(String string,
                                                            int index)
        从index位置切断字符串
        参数:
        string -
        index -
        返回:
      • cutTail

        public static String cutTail​(String string,
                                     String tail)
        切掉尾部字符串
        参数:
        string -
        tail -
        返回:
      • cutHead

        public static String cutHead​(String string,
                                     String head)
        切掉头部字符串
        参数:
        string -
        head -
        返回:
      • regexMatch

        public static List<String> regexMatch​(String string,
                                              String regex)
        正则取值
        参数:
        string -
        regex -
        返回:
      • regexMatchStartEnd

        public static List<String> regexMatchStartEnd​(String string,
                                                      String start,
                                                      String end)
        正则开头结尾匹配抓取中间字符串值
        参数:
        string -
        start -
        end -
        返回: