类 StringUtil


  • public class StringUtil
    extends Object
    版本:
    v1.0,Date:Oct 19, 2007 10:09:42 AM
    作者:
    zhongxuchen
    • 方法详细资料

      • toString

        public static String toString​(Object obj)
        参数:
        obj -
        返回:
      • isNotBlank

        public static boolean isNotBlank​(Object str)
        参数:
        str -
        返回:
      • isBlank

        public static boolean isBlank​(Object str)
      • clearMistyChars

        public static String clearMistyChars​(String source,
                                             String target)
        参数:
        source -
        target -
        返回:
      • firstToUpperCase

        public static String firstToUpperCase​(String sourceStr)
        参数:
        sourceStr -
        返回:
      • firstToLowerCase

        public static String firstToLowerCase​(String sourceStr)
        参数:
        sourceStr -
        返回:
      • firstToUpperOtherToLower

        public static String firstToUpperOtherToLower​(String sourceStr)
        参数:
        sourceStr -
        返回:
      • indexOfIgnoreCase

        public static int indexOfIgnoreCase​(String source,
                                            String pattern)
        参数:
        source -
        pattern -
        返回:
      • indexOfIgnoreCase

        public static int indexOfIgnoreCase​(String source,
                                            String pattern,
                                            int start)
      • addLeftZero2Len

        public static String addLeftZero2Len​(String source,
                                             int length)
        参数:
        source -
        length -
        返回:
      • addRightZero2Len

        public static String addRightZero2Len​(String source,
                                              int length)
      • addRightBlank2Len

        public static String addRightBlank2Len​(String source,
                                               int length)
        参数:
        source -
        length -
        返回:
      • loopAppendWithSign

        public static String loopAppendWithSign​(String source,
                                                String sign,
                                                int loopSize)
        参数:
        source -
        sign -
        loopSize -
        返回:
      • appendStr

        public static String appendStr​(String source,
                                       String sign,
                                       int size,
                                       boolean isLeft)
        参数:
        source -
        sign -
        size -
        isLeft -
      • getSymMarkIndex

        public static int getSymMarkIndex​(String beginMarkSign,
                                          String endMarkSign,
                                          String source,
                                          int startIndex)
        参数:
        beginMarkSign -
        endMarkSign -
        source -
        startIndex -
        返回:
      • getSymMarkIndexIgnoreCase

        public static int getSymMarkIndexIgnoreCase​(String beginMarkSign,
                                                    String endMarkSign,
                                                    String source,
                                                    int startIndex)
        参数:
        beginMarkSign -
        endMarkSign -
        source -
        startIndex -
        返回:
      • getSymMarkMatchIndex

        public static int getSymMarkMatchIndex​(String beginMarkSign,
                                               String endMarkSign,
                                               String source,
                                               int startIndex)
        参数:
        beginMarkSign -
        endMarkSign -
        source -
        startIndex -
        返回:
      • matches

        public static boolean matches​(String source,
                                      String regex)
        参数:
        source -
        regex -
        返回:
      • matches

        public static boolean matches​(String source,
                                      Pattern pattern)
        参数:
        source -
        pattern -
        返回:
      • matchIndex

        public static int matchIndex​(String source,
                                     String regex)
        参数:
        source -
        regex -
        返回:
      • matchIndex

        public static int[] matchIndex​(String source,
                                       String regex,
                                       int start)
      • matchIndex

        public static int matchIndex​(String source,
                                     Pattern pattern)
      • matchIndex

        public static int[] matchIndex​(String source,
                                       Pattern pattern,
                                       int start)
      • matchLastIndex

        public static int matchLastIndex​(String source,
                                         String regex)
      • matchLastIndex

        public static int matchLastIndex​(String source,
                                         Pattern pattern)
      • matchCnt

        public static int matchCnt​(String source,
                                   String regex)
        参数:
        source -
        regex -
        返回:
      • matchCnt

        public static int matchCnt​(String source,
                                   Pattern pattern)
        参数:
        source -
        pattern -
        返回:
      • matchCnt

        public static int matchCnt​(String source,
                                   String regex,
                                   int beginIndex,
                                   int endIndex)
        参数:
        source -
        regex -
        beginIndex -
        endIndex -
        返回:
      • indexOrder

        public static int indexOrder​(String source,
                                     String regex,
                                     int order)
        参数:
        source -
        regex -
        order -
        返回:
      • str2ASCII

        public static int[] str2ASCII​(String str)
        参数:
        str -
        返回:
      • splitExcludeSymMark

        public static String[] splitExcludeSymMark​(String source,
                                                   String splitSign,
                                                   HashMap filterMap)
        参数:
        source -
        splitSign - 如逗号、分号、冒号或具体字符串,非正则表达式
        filterMap -
        返回:
      • toHumpStr

        public static String toHumpStr​(String source,
                                       boolean firstIsUpperCase)
      • toHumpStr

        public static String toHumpStr​(String source,
                                       boolean firstIsUpperCase,
                                       boolean removeDealine)
        参数:
        source -
        firstIsUpperCase -
        removeDealine -
        返回:
      • secureMask

        public static String secureMask​(Object value,
                                        int preLength,
                                        int tailLength,
                                        String maskStr)
        参数:
        value -
        preLength -
        tailLength -
        maskStr -
        返回:
      • hasChinese

        public static boolean hasChinese​(String str)
        参数:
        str -
        返回:
      • humpToSplitStr

        public static String humpToSplitStr​(String source,
                                            String split)
        参数:
        source -
        split -
        返回:
      • humpFieldNames

        public static String[] humpFieldNames​(String[] labelNames)
        参数:
        labelNames -
        返回:
      • fillArgs

        public static String fillArgs​(String template,
                                      Object... args)
        参数:
        template -
        args -
        返回:
      • replaceAllStr

        public static String replaceAllStr​(String source,
                                           String template,
                                           String target)
        参数:
        source -
        template -
        target -
        返回:
      • replaceAllStr

        public static String replaceAllStr​(String source,
                                           String template,
                                           String target,
                                           int fromIndex)
      • replaceAllStr

        public static String replaceAllStr​(String source,
                                           String template,
                                           String target,
                                           int fromIndex,
                                           int endIndex)
      • toDBC

        public static String toDBC​(String SBCStr)
        参数:
        SBCStr -
        返回:
      • linkAry

        public static String linkAry​(String sign,
                                     boolean skipNull,
                                     Object... arys)
        参数:
        sign -
        skipNull -
        arys -
        返回:
      • like

        public static boolean like​(String source,
                                   String[] keywords)
        参数:
        source -
        keywords - 将匹配的字符用空格或者%进行切割并trim变成字符数组进行匹配
        返回:
      • arrayTrim

        public static void arrayTrim​(String[] params)