Options
All
  • Public
  • Public/Protected
  • All
Menu

Class StringUtils

Common string-related functions.

author

Sean Owen

author

Alex Dupre

Hierarchy

  • StringUtils

Index

Properties

Static Private ASSUME_SHIFT_JIS

ASSUME_SHIFT_JIS: boolean = false

Static Private EUC_JP

EUC_JP: string = "EUC_JP"

Static GB2312

GB2312: string = "GB2312"

Static ISO88591

ISO88591: string = CharacterSetECI.ISO8859_1.getName()

Static Private PLATFORM_DEFAULT_ENCODING

PLATFORM_DEFAULT_ENCODING: string = StringUtils.UTF8

Static SHIFT_JIS

SHIFT_JIS: string = CharacterSetECI.SJIS.getName()

Static Private UTF8

UTF8: string = CharacterSetECI.UTF8.getName()

Methods

Static castAsNonUtf8Char

  • castAsNonUtf8Char(code: number, encoding?: Charset): string

Static format

  • format(append: string, ...args: any[]): string

Static getBytes

Static getCharAt

  • getCharAt(charCode: number): string

Static getCharCode

  • getCharCode(str: string, index?: number): int
  • Returns the charcode at the specified index or at index zero.

    Parameters

    • str: string
    • Default value index: number = 0

    Returns int

Static guessEncoding

  • guessEncoding(bytes: Uint8Array, hints: Map<DecodeHintType, any>): string
  • Parameters

    • bytes: Uint8Array

      bytes encoding a string, whose encoding should be guessed

    • hints: Map<DecodeHintType, any>

      decode hints if applicable

    Returns string

    name of guessed encoding; at the moment will only guess one of: {@link #SHIFT_JIS}, {@link #UTF8}, {@link #ISO88591}, or the platform default encoding if none of these can possibly be correct

Generated using TypeDoc