Overview | Package | Class | Deprecated | Index | Help
| Groovy Documentation
| FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.codehaus.groovy.grails.commons
[Groovy] Class GrailsStringUtils

    java.lang.Object
      org.springframework.util.StringUtils
          org.codehaus.groovy.grails.commons.GrailsStringUtils

    @groovy.transform.CompileStatic
    abstract class GrailsStringUtils
    extends org.springframework.util.StringUtils

Extra methods for string manipulation

Authors:
  Graeme Rocher

Since:
  2.3.6

Method Summary
`static java.lang.String` | `getFileBasename(java.lang.String path)` Obtains the base name of a file excluding path and extension
`static boolean` | `isBlank(java.lang.String str)` Same as StringUtils#isEmpty(java.lang.Object) }
`static java.lang.String` | `substringAfter(java.lang.String str, java.lang.String token)` Returns a substring after the given token
`static java.lang.String` | `substringBefore(java.lang.String str, java.lang.String token)` Returns a substring before the given token
`static java.lang.String` | `trimStart(java.lang.String str, java.lang.String start)` Trims the start of the string

Methods inherited from class org.springframework.util.StringUtils
org.springframework.util.StringUtils#toLanguageTag(java.util.Locale), org.springframework.util.StringUtils#delete(java.lang.String, java.lang.String), org.springframework.util.StringUtils#quote(java.lang.String), org.springframework.util.StringUtils#isEmpty(java.lang.Object), org.springframework.util.StringUtils#replace(java.lang.String, java.lang.String, java.lang.String), org.springframework.util.StringUtils#split(java.lang.String, java.lang.String), org.springframework.util.StringUtils#capitalize(java.lang.String), org.springframework.util.StringUtils#uncapitalize(java.lang.String), org.springframework.util.StringUtils#startsWithIgnoreCase(java.lang.String, java.lang.String), org.springframework.util.StringUtils#endsWithIgnoreCase(java.lang.String, java.lang.String), org.springframework.util.StringUtils#toStringArray(java.util.Enumeration), org.springframework.util.StringUtils#toStringArray(java.util.Collection), org.springframework.util.StringUtils#getFilename(java.lang.String), org.springframework.util.StringUtils#hasText(java.lang.String), org.springframework.util.StringUtils#hasText(java.lang.CharSequence), org.springframework.util.StringUtils#arrayToDelimitedString([Ljava.lang.Object;, java.lang.String), org.springframework.util.StringUtils#arrayToCommaDelimitedString([Ljava.lang.Object;), org.springframework.util.StringUtils#cleanPath(java.lang.String), org.springframework.util.StringUtils#stripFilenameExtension(java.lang.String), org.springframework.util.StringUtils#pathEquals(java.lang.String, java.lang.String), org.springframework.util.StringUtils#parseLocaleString(java.lang.String), org.springframework.util.StringUtils#addStringToArray([Ljava.lang.String;, java.lang.String), org.springframework.util.StringUtils#concatenateStringArrays([Ljava.lang.String;, [Ljava.lang.String;), org.springframework.util.StringUtils#mergeStringArrays([Ljava.lang.String;, [Ljava.lang.String;), org.springframework.util.StringUtils#sortStringArray([Ljava.lang.String;), org.springframework.util.StringUtils#trimArrayElements([Ljava.lang.String;), org.springframework.util.StringUtils#removeDuplicateStrings([Ljava.lang.String;), org.springframework.util.StringUtils#splitArrayElementsIntoProperties([Ljava.lang.String;, java.lang.String), org.springframework.util.StringUtils#splitArrayElementsIntoProperties([Ljava.lang.String;, java.lang.String, java.lang.String), org.springframework.util.StringUtils#delimitedListToStringArray(java.lang.String, java.lang.String), org.springframework.util.StringUtils#delimitedListToStringArray(java.lang.String, java.lang.String, java.lang.String), org.springframework.util.StringUtils#commaDelimitedListToStringArray(java.lang.String), org.springframework.util.StringUtils#commaDelimitedListToSet(java.lang.String), org.springframework.util.StringUtils#collectionToDelimitedString(java.util.Collection, java.lang.String), org.springframework.util.StringUtils#collectionToDelimitedString(java.util.Collection, java.lang.String, java.lang.String, java.lang.String), org.springframework.util.StringUtils#containsWhitespace(java.lang.String), org.springframework.util.StringUtils#containsWhitespace(java.lang.CharSequence), org.springframework.util.StringUtils#trimWhitespace(java.lang.String), org.springframework.util.StringUtils#trimAllWhitespace(java.lang.String), org.springframework.util.StringUtils#trimLeadingWhitespace(java.lang.String), org.springframework.util.StringUtils#trimTrailingWhitespace(java.lang.String), org.springframework.util.StringUtils#trimLeadingCharacter(java.lang.String, char), org.springframework.util.StringUtils#trimTrailingCharacter(java.lang.String, char), org.springframework.util.StringUtils#substringMatch(java.lang.CharSequence, int, java.lang.CharSequence), org.springframework.util.StringUtils#countOccurrencesOf(java.lang.String, java.lang.String), org.springframework.util.StringUtils#deleteAny(java.lang.String, java.lang.String), org.springframework.util.StringUtils#quoteIfString(java.lang.Object), org.springframework.util.StringUtils#unqualify(java.lang.String), org.springframework.util.StringUtils#unqualify(java.lang.String, char), org.springframework.util.StringUtils#getFilenameExtension(java.lang.String), org.springframework.util.StringUtils#tokenizeToStringArray(java.lang.String, java.lang.String), org.springframework.util.StringUtils#tokenizeToStringArray(java.lang.String, java.lang.String, boolean, boolean), org.springframework.util.StringUtils#applyRelativePath(java.lang.String, java.lang.String), org.springframework.util.StringUtils#collectionToCommaDelimitedString(java.util.Collection), org.springframework.util.StringUtils#hasLength(java.lang.CharSequence), org.springframework.util.StringUtils#hasLength(java.lang.String), org.springframework.util.StringUtils#wait(long, int), org.springframework.util.StringUtils#wait(long), org.springframework.util.StringUtils#wait(), org.springframework.util.StringUtils#equals(java.lang.Object), org.springframework.util.StringUtils#toString(), org.springframework.util.StringUtils#hashCode(), org.springframework.util.StringUtils#getClass(), org.springframework.util.StringUtils#notify(), org.springframework.util.StringUtils#notifyAll()

Methods inherited from class java.lang.Object
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()

Method Detail

### getFileBasename

    static java.lang.String getFileBasename(java.lang.String path)

  Obtains the base name of a file excluding path and extension
  Parameters:
    `path` - The path
  Returns:
    The name of the file excluding path and extension

### isBlank

    static boolean isBlank(java.lang.String str)

  Same as StringUtils#isEmpty(java.lang.Object) }

### substringAfter

    static java.lang.String substringAfter(java.lang.String str, java.lang.String token)

  Returns a substring after the given token GrailsStringUtils.substringAfter(null, *) = null GrailsStringUtils.substringAfter("", *) = "" GrailsStringUtils.substringAfter(*, null) = "" GrailsStringUtils.substringAfter("abc", "a") = "bc" GrailsStringUtils.substringAfter("abcba", "b") = "cba" GrailsStringUtils.substringAfter("abc", "c") = "" GrailsStringUtils.substringAfter("abc", "d") = "" GrailsStringUtils.substringAfter("abc", "") = "abc"
  Parameters:
    `str` - The string to apply the substring
    `token` - The token to match

### substringBefore

    static java.lang.String substringBefore(java.lang.String str, java.lang.String token)

  Returns a substring before the given token GrailsStringUtils.substringBefore(null, *) = null GrailsStringUtils.substringBefore("", *) = "" GrailsStringUtils.substringBefore("abc", "a") = "" GrailsStringUtils.substringBefore("abcba", "b") = "a" GrailsStringUtils.substringBefore("abc", "c") = "ab" GrailsStringUtils.substringBefore("abc", "d") = "abc" GrailsStringUtils.substringBefore("abc", "") = "" GrailsStringUtils.substringBefore("abc", null) = "abc"
  Parameters:
    `str` - The string to apply the substring
    `token` - The token to match

### trimStart

    static java.lang.String trimStart(java.lang.String str, java.lang.String start)

  Trims the start of the string
  Parameters:
    `str` - The string to trim
    `start` - The start to trim
  Returns:
    The trimmed string

Groovy Documentation