coldbox.system.core.delegates

Class StringUtil

lucee.Component
    extended by coldbox.system.core.delegates.StringUtil

Copyright Since 2005 ColdBox Framework by Luis Majano and Ortus Solutions, Corp www.ortussolutions.com --- A delegate for string manipulation and operations

Class Attributes:
  • singleton
  •  
  • synchronized : false
  •  
  • accessors : false
  •  
  • persistent : false
  •  
    Method Summary
    any camelCase(any target)
         Convert a string to camel case using a functional approach.
    any headline(any target)
         Create a headline from a string delimited by casing, hyphens, or underscores into a space delimited string with each word's first letter capitalized:.
    any kebabCase(any target)
         Create kebab-case from a string.
    any lcFirst(any target)
         Lowercase the first letter of the string.
    any pluralize(any word)
         Convert a singular word to a plural word.
    any singularize(any word)
         Convert a plural word to a singular word.
    any slugify(any str, [numeric maxLength='0'], [any allow=''])
         Slugify a string for URL Safety.
    any snakeCase(any target, [any delimiter='_'])
         Convert a string to snake case.
    any ucFirst(any target)
         Uppercase the first letter of a string.
     
    Methods inherited from class lucee.Component
    None

    Method Detail

    camelCase

    public any camelCase(any target)

    Convert a string to camel case using a functional approach.

    Parameters:
    target - The string to convert to camel case.
    Returns:
    The string in camel case.

    headline

    public any headline(any target)

    Create a headline from a string delimited by casing, hyphens, or underscores into a space delimited string with each word's first letter capitalized:

    Parameters:
    target - The string to convert to a headline.

    kebabCase

    public any kebabCase(any target)

    Create kebab-case from a string.

    Parameters:
    target - The string to convert to kebab-case.
    Returns:
    The kebab-case string.

    lcFirst

    public any lcFirst(any target)

    Lowercase the first letter of the string

    Parameters:
    target - The incoming string

    pluralize

    public any pluralize(any word)

    Convert a singular word to a plural word

    Parameters:
    word - The word to convert

    singularize

    public any singularize(any word)

    Convert a plural word to a singular word

    Parameters:
    word - The word to convert

    slugify

    public any slugify(any str, [numeric maxLength='0'], [any allow=''])

    Slugify a string for URL Safety

    Parameters:
    str - Target to slugify
    maxLength - The maximum number of characters for the slug
    allow - a regex safe list of additional characters to allow

    snakeCase

    public any snakeCase(any target, [any delimiter='_'])

    Convert a string to snake case.

    Parameters:
    target - The string to convert to snake case.
    delimiter - The delimiter to use (default is underscore).
    Returns:
    The string in snake case.

    ucFirst

    public any ucFirst(any target)

    Uppercase the first letter of a string.

    Parameters:
    target - The target string