Options
All
  • Public
  • Public/Protected
  • All
Menu

Module Str

The Str module provides utility methods for dealing with strings.

Index

Functions

Const at

  • at(...args: any[]): any
  • Retrieves the character at specified index.

    Returns null if index is greater than the length of the string, or if the string argument is not a valid string

    Parameters

    • Rest ...args: any[]

    Returns any

    Usage:

    Str.at(1, "hello")     // e
    

Const concat

  • concat(...strs: string[]): string
  • Concatenate strings together

    throws

    Arguments to Str.concat must be strings.

    Usage:

    Str.concat("Hello", " ", "world!")     // "Hello world!"
    

    Parameters

    • Rest ...strs: string[]

    Returns string

    the concatenated string

Const endsWith

  • endsWith(...args: any[]): any
  • Checks if a string ends with the given substring

    Parameters

    • Rest ...args: any[]

    Returns any

    number indicating whether the reference string comes before or after the comparison string

    Usage:

    Str.localeCompare('réservé', 'RESERVE')     // 1
    

Const includes

  • includes(...args: any[]): any
  • Check if a string is included as a substring of another string

    Parameters

    • Rest ...args: any[]

    Returns any

    Usage:

    Str.includes("Jim", "My name might just be Jim Pickens...")     // true
    

Const isString

  • isString(...args: any[]): any
  • Indicates if value is a string or an instance of String

    Parameters

    • Rest ...args: any[]

    Returns any

    Usage:

    Str.isString("hello")                // true
    Str.isString(new String("hello"))    // true
    Str.isString([])                     // false
    

Const localeCompare

  • localeCompare(a: string, b: string, ...args: any[]): number
  • Wrapper around String.prototype.localeCompare

    Cannot yet be curried because it can take varargs

    Parameters

    • a: string
    • b: string
    • Rest ...args: any[]

    Returns number

    number indicating whether the reference string comes before or after the comparison string

    Usage:

    Str.localeCompare('réservé', 'RESERVE')     // 1
    

Const match

  • match(...args: any[]): any
  • Parameters

    • Rest ...args: any[]

    Returns any

Const slice

  • slice(...args: any[]): any
  • Parameters

    • Rest ...args: any[]

    Returns any

Const split

  • split(...args: any[]): any
  • Parameters

    • Rest ...args: any[]

    Returns any

Const toLocaleLowerCase

  • toLocaleLowerCase(...args: any[]): any
  • Parameters

    • Rest ...args: any[]

    Returns any

Const toLocaleUpperCase

  • toLocaleUpperCase(...args: any[]): any
  • Parameters

    • Rest ...args: any[]

    Returns any

Const toLowerCase

  • toLowerCase(...args: any[]): any
  • Parameters

    • Rest ...args: any[]

    Returns any

Const toUpperCase

  • toUpperCase(...args: any[]): any
  • Parameters

    • Rest ...args: any[]

    Returns any

Const trim

  • trim(...args: any[]): any
  • Parameters

    • Rest ...args: any[]

    Returns any

Made by Horyus. Documentation generated by TypeDoc.