Class StringUtils
java.lang.Object
org.apache.groovy.parser.antlr4.util.StringUtils
public class StringUtils
extends java.lang.Object
Utilities for handling strings
- 
Field SummaryFields Modifier and Type Field Description static intDOLLAR_SLASHYstatic intNONE_SLASHYstatic intSLASHY
- 
Constructor SummaryConstructors Constructor Description StringUtils()
- 
Method SummaryModifier and Type Method Description static longcountChar(java.lang.String text, char c)static booleanisEmpty(java.lang.CharSequence cs)Copied from Apache commons-lang3-3.6static booleanmatches(java.lang.String text, java.util.regex.Pattern pattern)static java.lang.StringremoveCR(java.lang.String text)static java.lang.Stringreplace(java.lang.String text, java.lang.String searchString, java.lang.String replacement)The modified implementation is based on StringUtils#replace(String text, String searchString, String replacement, int max), Apache commons-lang3-3.6static java.lang.StringreplaceEscapes(java.lang.String text, int slashyType)static java.lang.StringreplaceHexEscapes(java.lang.String text)static java.lang.StringreplaceOctalEscapes(java.lang.String text)static java.lang.StringreplaceStandardEscapes(java.lang.String text)static java.lang.StringtrimQuotations(java.lang.String text, int quotationLength)Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
- 
Field Details- 
NONE_SLASHYpublic static final int NONE_SLASHY- See Also:
- Constant Field Values
 
- 
SLASHYpublic static final int SLASHY- See Also:
- Constant Field Values
 
- 
DOLLAR_SLASHYpublic static final int DOLLAR_SLASHY- See Also:
- Constant Field Values
 
 
- 
- 
Constructor Details- 
StringUtilspublic StringUtils()
 
- 
- 
Method Details- 
replaceHexEscapespublic static java.lang.String replaceHexEscapes(java.lang.String text)
- 
replaceOctalEscapespublic static java.lang.String replaceOctalEscapes(java.lang.String text)
- 
replaceStandardEscapespublic static java.lang.String replaceStandardEscapes(java.lang.String text)
- 
replaceEscapespublic static java.lang.String replaceEscapes(java.lang.String text, int slashyType)
- 
removeCRpublic static java.lang.String removeCR(java.lang.String text)
- 
countCharpublic static long countChar(java.lang.String text, char c)
- 
trimQuotationspublic static java.lang.String trimQuotations(java.lang.String text, int quotationLength)
- 
matchespublic static boolean matches(java.lang.String text, java.util.regex.Pattern pattern)
- 
replacepublic static java.lang.String replace(java.lang.String text, java.lang.String searchString, java.lang.String replacement)The 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
 
- 
isEmptypublic static boolean isEmpty(java.lang.CharSequence cs)Copied 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
 
 
-