Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • LoDashStatic

Index

Methods

camelCase

  • camelCase(string?: undefined | string): string
  • Converts string to camel case.

    Parameters

    • Optional string: undefined | string

      The string to convert.

    Returns string

    Returns the camel cased string.

capitalize

  • capitalize(string?: undefined | string): string
  • Converts the first character of string to upper case and the remaining to lower case.

    Parameters

    • Optional string: undefined | string

      The string to capitalize.

    Returns string

    Returns the capitalized string.

deburr

  • deburr(string?: undefined | string): string
  • Deburrs string by converting latin-1 supplementary letters to basic latin letters and removing combining diacritical marks.

    Parameters

    • Optional string: undefined | string

      The string to deburr.

    Returns string

    Returns the deburred string.

endsWith

  • endsWith(string?: undefined | string, target?: undefined | string, position?: undefined | number): boolean
  • Checks if string ends with the given target string.

    Parameters

    • Optional string: undefined | string

      The string to search.

    • Optional target: undefined | string

      The string to search for.

    • Optional position: undefined | number

      The position to search from.

    Returns boolean

    Returns true if string ends with target, else false.

escape

  • escape(string?: undefined | string): string
  • Converts the characters "&", "<", ">", '"', "'", and "`" in string to their corresponding HTML entities.

    Note: No other characters are escaped. To escape additional characters use a third-party library like he.

    hough the ">" character is escaped for symmetry, characters like ">" and "/" don’t need escaping in HTML and have no special meaning unless they're part of a tag or unquoted attribute value. See Mathias Bynens’s article (under "semi-related fun fact") for more details.

    Backticks are escaped because in IE < 9, they can break out of attribute values or HTML comments. See #59,

    #102, #108, and #133 of the HTML5 Security Cheatsheet for more details.

    When working with HTML you should always quote attribute values to reduce XSS vectors.

    Parameters

    • Optional string: undefined | string

      The string to escape.

    Returns string

    Returns the escaped string.

escapeRegExp

  • escapeRegExp(string?: undefined | string): string
  • Escapes the RegExp special characters "^", "$", "", ".", "*", "+", "?", "(", ")", "[", "]", "{", "}", and "|" in string.

    Parameters

    • Optional string: undefined | string

      The string to escape.

    Returns string

    Returns the escaped string.

kebabCase

  • kebabCase(string?: undefined | string): string
  • Converts string to kebab case.

    Parameters

    • Optional string: undefined | string

      The string to convert.

    Returns string

    Returns the kebab cased string.

lowerCase

  • lowerCase(string?: undefined | string): string
  • Converts string, as space separated words, to lower case.

    Parameters

    • Optional string: undefined | string

      The string to convert.

    Returns string

    Returns the lower cased string.

lowerFirst

  • lowerFirst(string?: undefined | string): string
  • Converts the first character of string to lower case.

    Parameters

    • Optional string: undefined | string

      The string to convert.

    Returns string

    Returns the converted string.

pad

  • pad(string?: undefined | string, length?: undefined | number, chars?: undefined | string): string
  • Pads string on the left and right sides if it’s shorter than length. Padding characters are truncated if they can’t be evenly divided by length.

    Parameters

    • Optional string: undefined | string

      The string to pad.

    • Optional length: undefined | number

      The padding length.

    • Optional chars: undefined | string

      The string used as padding.

    Returns string

    Returns the padded string.

padEnd

  • padEnd(string?: undefined | string, length?: undefined | number, chars?: undefined | string): string
  • Pads string on the right side if it’s shorter than length. Padding characters are truncated if they exceed length.

    Parameters

    • Optional string: undefined | string

      The string to pad.

    • Optional length: undefined | number

      The padding length.

    • Optional chars: undefined | string

      The string used as padding.

    Returns string

    Returns the padded string.

padStart

  • padStart(string?: undefined | string, length?: undefined | number, chars?: undefined | string): string
  • Pads string on the left side if it’s shorter than length. Padding characters are truncated if they exceed length.

    Parameters

    • Optional string: undefined | string

      The string to pad.

    • Optional length: undefined | number

      The padding length.

    • Optional chars: undefined | string

      The string used as padding.

    Returns string

    Returns the padded string.

parseInt

  • parseInt(string: string, radix?: undefined | number): number
  • Converts string to an integer of the specified radix. If radix is undefined or 0, a radix of 10 is used unless value is a hexadecimal, in which case a radix of 16 is used.

    Note: This method aligns with the ES5 implementation of parseInt.

    Parameters

    • string: string

      The string to convert.

    • Optional radix: undefined | number

      The radix to interpret value by.

    Returns number

    Returns the converted integer.

repeat

  • repeat(string?: undefined | string, n?: undefined | number): string
  • Repeats the given string n times.

    Parameters

    • Optional string: undefined | string

      The string to repeat.

    • Optional n: undefined | number

      The number of times to repeat the string.

    Returns string

    Returns the repeated string.

replace

  • replace(string: string, pattern: RegExp | string, replacement: ReplaceFunction | string): string
  • replace(pattern: RegExp | string, replacement: ReplaceFunction | string): string
  • Replaces matches for pattern in string with replacement.

    Note: This method is based on String#replace.

    Parameters

    • string: string
    • pattern: RegExp | string
    • replacement: ReplaceFunction | string

    Returns string

    Returns the modified string.

  • see

    _.replace

    Parameters

    Returns string

snakeCase

  • snakeCase(string?: undefined | string): string
  • Converts string to snake case.

    Parameters

    • Optional string: undefined | string

      The string to convert.

    Returns string

    Returns the snake cased string.

split

  • split(string: string, separator?: RegExp | string, limit?: undefined | number): string[]
  • split(string: string, index: string | number, guard: object): string[]
  • Splits string by separator.

    Note: This method is based on String#split.

    Parameters

    • string: string

      The string to trim.

    • Optional separator: RegExp | string

      The separator pattern to split by.

    • Optional limit: undefined | number

      The length to truncate results to.

    Returns string[]

    Returns the new array of string segments.

  • Splits string by separator.

    Note: This method is based on String#split.

    Parameters

    • string: string

      The string to trim.

    • index: string | number

      Not used in this overload.

    • guard: object

      Enables use as an iteratee for methods like _.map. You should not pass this parameter directly in your code.

    Returns string[]

    Returns the new array of string segments.

startCase

  • startCase(string?: undefined | string): string
  • Converts string to start case.

    Parameters

    • Optional string: undefined | string

      The string to convert.

    Returns string

    Returns the start cased string.

startsWith

  • startsWith(string?: undefined | string, target?: undefined | string, position?: undefined | number): boolean
  • Checks if string starts with the given target string.

    Parameters

    • Optional string: undefined | string

      The string to search.

    • Optional target: undefined | string

      The string to search for.

    • Optional position: undefined | number

      The position to search from.

    Returns boolean

    Returns true if string starts with target, else false.

template

  • Creates a compiled template function that can interpolate data properties in "interpolate" delimiters, HTML-escape interpolated data properties in "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data properties may be accessed as free variables in the template. If a setting object is provided it takes precedence over _.templateSettings values.

    Note: In the development build _.template utilizes sourceURLs for easier debugging.

    For more information on precompiling templates see lodash's custom builds documentation.

    For more information on Chrome extension sandboxes see Chrome's extensions documentation.

    Parameters

    • Optional string: undefined | string

      The template string.

    • Optional options: TemplateOptions

      The options object.

    Returns TemplateExecutor

    Returns the compiled template function.

toLower

  • toLower(string?: undefined | string): string
  • Converts string, as a whole, to lower case.

    Parameters

    • Optional string: undefined | string

      The string to convert.

    Returns string

    Returns the lower cased string.

toUpper

  • toUpper(string?: undefined | string): string
  • Converts string, as a whole, to upper case.

    Parameters

    • Optional string: undefined | string

      The string to convert.

    Returns string

    Returns the upper cased string.

trim

  • trim(string?: undefined | string, chars?: undefined | string): string
  • trim(string: string, index: string | number, guard: object): string
  • Removes leading and trailing whitespace or specified characters from string.

    Parameters

    • Optional string: undefined | string

      The string to trim.

    • Optional chars: undefined | string

      The characters to trim.

    Returns string

    Returns the trimmed string.

  • Removes leading and trailing whitespace or specified characters from string.

    Parameters

    • string: string

      The string to trim.

    • index: string | number

      Not used in this overload.

    • guard: object

      Enables use as an iteratee for methods like _.map. You should not pass this parameter directly in your code.

    Returns string

    Returns the trimmed string.

trimEnd

  • trimEnd(string?: undefined | string, chars?: undefined | string): string
  • trimEnd(string: string, index: string | number, guard: object): string
  • Removes trailing whitespace or specified characters from string.

    Parameters

    • Optional string: undefined | string

      The string to trim.

    • Optional chars: undefined | string

      The characters to trim.

    Returns string

    Returns the trimmed string.

  • Removes trailing whitespace or specified characters from string.

    Parameters

    • string: string

      The string to trim.

    • index: string | number

      Not used in this overload.

    • guard: object

      Enables use as an iteratee for methods like _.map. You should not pass this parameter directly in your code.

    Returns string

    Returns the trimmed string.

trimStart

  • trimStart(string?: undefined | string, chars?: undefined | string): string
  • trimStart(string: string, index: string | number, guard: object): string
  • Removes leading whitespace or specified characters from string.

    Parameters

    • Optional string: undefined | string

      The string to trim.

    • Optional chars: undefined | string

      The characters to trim.

    Returns string

    Returns the trimmed string.

  • Removes leading whitespace or specified characters from string.

    Parameters

    • string: string

      The string to trim.

    • index: string | number

      Not used in this overload.

    • guard: object

      Enables use as an iteratee for methods like _.map. You should not pass this parameter directly in your code.

    Returns string

    Returns the trimmed string.

truncate

  • Truncates string if it’s longer than the given maximum string length. The last characters of the truncated string are replaced with the omission string which defaults to "…".

    Parameters

    • Optional string: undefined | string

      The string to truncate.

    • Optional options: TruncateOptions

      The options object or maximum string length.

    Returns string

    Returns the truncated string.

unescape

  • unescape(string?: undefined | string): string
  • The inverse of _.escape; this method converts the HTML entities &, <, >, ", ', and ` in string to their corresponding characters.

    Note: No other HTML entities are unescaped. To unescape additional HTML entities use a third-party library like he.

    Parameters

    • Optional string: undefined | string

      The string to unescape.

    Returns string

    Returns the unescaped string.

upperCase

  • upperCase(string?: undefined | string): string
  • Converts string, as space separated words, to upper case.

    Parameters

    • Optional string: undefined | string

      The string to convert.

    Returns string

    Returns the upper cased string.

upperFirst

  • upperFirst(string?: undefined | string): string
  • Converts the first character of string to upper case.

    Parameters

    • Optional string: undefined | string

      The string to convert.

    Returns string

    Returns the converted string.

words

  • words(string?: undefined | string, pattern?: string | RegExp): string[]
  • words(string: string, index: string | number, guard: object): string[]
  • Splits string into an array of its words.

    Parameters

    • Optional string: undefined | string

      The string to inspect.

    • Optional pattern: string | RegExp

      The pattern to match words.

    Returns string[]

    Returns the words of string.

  • Splits string into an array of its words.

    Parameters

    • string: string

      The string to inspect.

    • index: string | number

      Not used in this overload.

    • guard: object

      Enables use as an iteratee for methods like _.map. You should not pass this parameter directly in your code.

    Returns string[]

    Returns the words of string.

Generated using TypeDoc