StringTools

Helper to manipulate strings

Hierarchy

  • StringTools

Index

Methods

Static Decode

Find examples in Playground
  • Decode(buffer: Uint8Array | Uint16Array): string
  • Decodes a buffer into a string

    Parameters

    • buffer: Uint8Array | Uint16Array

      The buffer to decode

    Returns string

    The decoded string

Static EncodeArrayBufferToBase64

Find examples in Playground
  • EncodeArrayBufferToBase64(buffer: ArrayBuffer | ArrayBufferView): string
  • Encode a buffer to a base64 string

    Parameters

    • buffer: ArrayBuffer | ArrayBufferView

      defines the buffer to encode

    Returns string

    the encoded string

Static EndsWith

Find examples in Playground
  • EndsWith(str: string, suffix: string): boolean
  • Checks for a matching suffix at the end of a string (for ES5 and lower)

    Parameters

    • str: string

      Source string

    • suffix: string

      Suffix to search for in the source string

    Returns boolean

    Boolean indicating whether the suffix was found (true) or not (false)

Static StartsWith

Find examples in Playground
  • StartsWith(str: string, suffix: string): boolean
  • Checks for a matching suffix at the beginning of a string (for ES5 and lower)

    Parameters

    • str: string

      Source string

    • suffix: string

      Suffix to search for in the source string

    Returns boolean

    Boolean indicating whether the suffix was found (true) or not (false)

Generated using TypeDoc