Options
All
  • Public
  • Public/Protected
  • All
Menu

Class StringTools

Helper to manipulate strings

Hierarchy

  • StringTools

Index

Methods

Static DecodeSearch playground for Decode

  • 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 EncodeArrayBufferToBase64Search playground for EncodeArrayBufferToBase64

  • 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 EndsWithSearch playground for EndsWith

  • 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 PadNumberSearch playground for PadNumber

  • PadNumber(num: number, length: number): string
  • Converts a number to string and pads with preceeding zeroes until it is of specified length.

    Parameters

    • num: number

      the number to convert and pad

    • length: number

      the expected length of the string

    Returns string

    the padded string

Static StartsWithSearch playground for StartsWith

  • 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)

Legend

  • Constructor
  • Property
  • Method
  • Property
  • Method
  • Inherited property
  • Inherited method
  • Static property
  • Static method