Class StringUtils


  • public class StringUtils
    extends org.apache.velocity.util.StringUtils
    General string handling method utils, typically used in test templates. Date: 26/11/2016
    Author:
    Yaron Yamin
    • Constructor Summary

      Constructors 
      Constructor Description
      StringUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String camelCaseToWords​(java.lang.String data)  
      static java.lang.String deCapitalizeFirstLetter​(java.lang.String data)  
      static boolean hasLine​(java.lang.String multiLineText, java.lang.String toFind)  
      static java.lang.String removeSuffix​(java.lang.String str, java.lang.String suffix)  
      • Methods inherited from class org.apache.velocity.util.StringUtils

        allEmpty, capitalizeFirstLetter, chop, chop, collapseNewlines, collapseSpaces, concat, fileContentsToString, firstLetterCaps, getPackageAsPath, normalizePath, nullTrim, removeAndHump, removeAndHump, removeUnderScores, select, split, stackTrace, stringSubstitution, stringSubstitution, sub, trimStrings
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • StringUtils

        public StringUtils()
    • Method Detail

      • deCapitalizeFirstLetter

        public static java.lang.String deCapitalizeFirstLetter​(java.lang.String data)
        Returns:
        the input data string where first letter converted to lower case
      • camelCaseToWords

        public static java.lang.String camelCaseToWords​(java.lang.String data)
        Parameters:
        data - string in camel case
        Returns:
        input string separated to word from camel case format
      • hasLine

        public static boolean hasLine​(java.lang.String multiLineText,
                                      java.lang.String toFind)
        Parameters:
        multiLineText - text with possible new lines
        toFind - text to find
        Returns:
        true - if toFind exists in text lines ( doesn't span in multiple lines)
      • removeSuffix

        public static java.lang.String removeSuffix​(java.lang.String str,
                                                    java.lang.String suffix)
        Parameters:
        str - input string, possibly containing input suffix
        suffix - possible suffix of input text
        Returns:
        input str without the suffix if indeed is a suffix of input str