Class StringUtils
java.lang.Object
org.apache.groovy.parser.antlr4.util.StringUtils
Utilities for handling strings
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final int
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic longstatic booleanisEmpty(CharSequence cs) Copied from Apache commons-lang3-3.6static booleanstatic Stringstatic StringThe modified implementation is based on StringUtils#replace(String text, String searchString, String replacement, int max), Apache commons-lang3-3.6static StringreplaceEscapes(String text, int slashyType) static StringreplaceHexEscapes(String text) static StringreplaceOctalEscapes(String text) static StringreplaceStandardEscapes(String text) static StringtrimQuotations(String text, int quotationLength) 
- 
Field Details- 
NONE_SLASHYpublic static final int NONE_SLASHY- See Also:
 
- 
SLASHYpublic static final int SLASHY- See Also:
 
- 
DOLLAR_SLASHYpublic static final int DOLLAR_SLASHY- See Also:
 
 
- 
- 
Constructor Details- 
StringUtilspublic StringUtils()
 
- 
- 
Method Details- 
replaceEscapes
- 
replaceHexEscapes
- 
replaceOctalEscapes
- 
replaceStandardEscapes
- 
removeCR
- 
countChar
- 
trimQuotations
- 
matches
- 
replaceThe modified implementation is based on StringUtils#replace(String text, String searchString, String replacement, int max), Apache commons-lang3-3.6Replaces all occurrences of a String within another String. A nullreference passed to this method is a no-op.StringUtils.replace(null, *, *) = null StringUtils.replace("", *, *) = "" StringUtils.replace("any", null, *) = "any" StringUtils.replace("any", *, null) = "any" StringUtils.replace("any", "", *) = "any" StringUtils.replace("aba", "a", null) = "aba" StringUtils.replace("aba", "a", "") = "b" StringUtils.replace("aba", "a", "z") = "zbz"- Parameters:
- text- text to search and replace in, may be null
- searchString- the String to search for, may be null
- replacement- the String to replace it with, may be null
- Returns:
- the text with any replacements processed,
  nullif null String input
 
- 
isEmptyCopied from Apache commons-lang3-3.6Checks if a CharSequence is empty ("") or null. StringUtils.isEmpty(null) = true StringUtils.isEmpty("") = true StringUtils.isEmpty(" ") = false StringUtils.isEmpty("bob") = false StringUtils.isEmpty(" bob ") = falseNOTE: This method changed in Lang version 2.0. It no longer trims the CharSequence. That functionality is available in isBlank(). - Parameters:
- cs- the CharSequence to check, may be null
- Returns:
- trueif the CharSequence is empty or null
 
 
-