Class StringUtils

  • public class StringUtils
    extends Object
    • Method Detail

      • pad

        public static String pad​(String str,
                                 int padlen,
                                 String pad)
        Pads out a string upto padlen with pad chars
        str - string to be padded
        padlen - length of pad (+ve = pad on right, -ve pad on left)
        pad - character
        padded string
      • toCharExp

        public static String toCharExp​(String strRegExp)
        Convert a regexp formed with integer charachter into a char formed regexp for instance, "12%12%" which stands for 1 followed by 2 followed by 12 would be misinterpreted by regular regular expression parser. We use here the asci code to encode everything as a single char. Due to char encoding limits, we cannot parse int greater than 2^16-1
        strRegExp - a regexp of integer
        a char regexp