Class StringUtil


  • public class StringUtil
    extends Object
    • Constructor Detail

      • StringUtil

        public StringUtil()
    • Method Detail

      • hasLength

        public static boolean hasLength​(String _text)
        check its have null or empty string
        Parameters:
        _text -
        Returns:
        boolean
      • hasText

        public static boolean hasText​(Object _text)
        check its type of string or char values
        Parameters:
        _text -
        Returns:
        boolean
      • isEmpty

        public static boolean isEmpty​(Object _text)
        check its null or empty char values
        Parameters:
        _text -
        Returns:
        boolean
      • isEmpty

        public static boolean isEmpty​(String _text)
        check its null or empty char values
        Parameters:
        _text -
        Returns:
        boolean
      • isNonEmpty

        public static boolean isNonEmpty​(String _v)
        check its not null or empty char values
        Parameters:
        _text -
        Returns:
        boolean
      • contains

        public static boolean contains​(String _search,
                                       String... sources)

        This method searches for a specified string in string array.

        Parameters:
        sources - array in which string is to be searched
        _search - string that is to be searched.
        Returns:
        boolean true,if string is found in array fasle, if string is not found in the specified array.
        Since:
        Foundation 1.0
      • containsEquals

        public static boolean containsEquals​(Object obj1,
                                             Object obj2)

        This method matching for both object .

        Parameters:
        obj1 - any type of object
        obj2 - any type of object
        Returns:
        boolean true,if string is found in array false, if string is not found in the specified array.
        Since:
        brijframework 1.0
      • matchIgnoreCase

        public static boolean matchIgnoreCase​(Object obj1,
                                              Object obj2)

        This method matching ignoreCase for both object .

        Parameters:
        obj1 - any type of object
        obj2 - any type of object
        Returns:
        boolean true,if string is found in array false, if string is not found in the specified array.
        Since:
        brijframework 1.0
      • containsIgnoreCase

        public static boolean containsIgnoreCase​(String[] stringArray,
                                                 String searchString)

        This method searches for a specified string in string array ignoring the case.

        Parameters:
        stringArray - array in which string is to be searched
        searchString - string that is to be searched.
        Returns:
        boolean true,if string is found in array fasle, if string is not found in the specified array.
        Since:
        brijframework 1.0
      • containsIgnoreCase

        public static boolean containsIgnoreCase​(Object stringArray,
                                                 Object searchString)

        This method searches for a specified string in string array ignoring the case.

        Parameters:
        stringArray - array in which string is to be searched
        searchString - string that is to be searched.
        Returns:
        boolean true,if string is found in array fasle, if string is not found in the specified array.
        Since:
        brijframework 1.0
      • containsIgnoreCase

        public static boolean containsIgnoreCase​(Object[] stringArray,
                                                 Object searchString)

        This method searches for a specified string in string array ignoring the case.

        Parameters:
        stringArray - array in which string is to be searched
        searchString - string that is to be searched.
        Returns:
        boolean true,if string is found in array fasle, if string is not found in the specified array.
        Since:
        brijframework 1.0
      • cleanText

        public static String cleanText​(String _source)
        clean all and get string only number or char
        Parameters:
        _source -
        Returns:
        string
      • cleanAndReplaceText

        public static String cleanAndReplaceText​(String _source,
                                                 String _replaceValue)
        clean all and replace ignore value to replace value and get string only number or char
        Parameters:
        _source -
        _replaceValue -
        Returns:
        string
      • ignoreFromText

        public static String ignoreFromText​(String _source,
                                            char _harToDump)
        Ignore value and get clean text
        Parameters:
        _source -
        _harToDump -
        Returns:
        string
      • getTokenAtIndex

        public static String getTokenAtIndex​(String _source,
                                             int index,
                                             String delimiter)
        Will get the token at a specified index in the string according to the delimiter we want to tokenize the string with.
        Parameters:
        _source - String
        index - int
        delimiter - String
        Returns:
        String
      • reverseText

        public static String reverseText​(String _source)
        reverse text of sources text
        Parameters:
        _source -
        Returns:
        destination
      • replaceText

        public static String replaceText​(String _sources,
                                         String replaceText,
                                         String withText)
        this is for replace text with given text from text
        Parameters:
        _sources -
        replaceText -
        withText -
        Returns:
        replace text
      • capitalFirst

        public static String capitalFirst​(String text)
        capital first letter in text
        Parameters:
        text -
        Returns:
        first capital text
      • lowerFirst

        public static String lowerFirst​(String text)
        lower first letter in text
        Parameters:
        text -
        Returns:
        first capital text
      • capitalFirstLetterText

        public static String capitalFirstLetterText​(String _textline)
        Capital first letter of word in text
        Parameters:
        _textline -
        Returns:
        capital test
      • justifyText

        public static String justifyText​(String _source,
                                         int length,
                                         boolean isLeftJustify,
                                         char filled)
        Justify text given text
        Parameters:
        _source -
        length -
        isLeftJustify -
        filled -
        Returns:
        justify text
      • charCountInText

        public static int charCountInText​(String _sources,
                                          char ch)
      • arrayToTildeText

        public static String arrayToTildeText​(Object[] array)
      • getCharNTimes

        public static String getCharNTimes​(char c,
                                           int n)
      • arrayToCommaText

        public static String arrayToCommaText​(Object[] array)
      • toCamelCase

        public static String toCamelCase​(String str)
      • stringValue

        public static String stringValue​(Object obj)
      • addUnderScoreBeforeUpperCaseLetter

        public static String addUnderScoreBeforeUpperCaseLetter​(String str)
        converts string format put UnderScore '_' before first Cap char and converts to UPPER case eg. if value of str is 'BrijSoftware' then it will converted to 'BRIJ_SOFTWARE'
        Parameters:
        str - String need to modify
        Returns:
        modified String
      • friendlyNameForJavaVar

        public static String friendlyNameForJavaVar​(String string)

        method is used to get the title case format for the string passed. for e.g. variableName the title case String would be Variable Name

        Example

        FNUtil.getTitleCaseString("variableName"); // result would be Variable Name

        Parameters:
        string - containing the text to be converted into title case format
        Returns:
        String object having passed string in title case
        Since:
        Foundation 1.0
      • maskString

        public static String maskString​(String rawStr,
                                        char c,
                                        String format)
      • charIndex

        public static int charIndex​(String sources,
                                    int start,
                                    char ch)
      • main

        public static void main​(String[] args)
      • parseTilde

        public static String[] parseTilde​(String objectKeys)
      • indexOfIgnoreCase

        public static int indexOfIgnoreCase​(String typeName,
                                            String string)