Options
All
  • Public
  • Public/Protected
  • All
Menu

String helper class.

Hierarchy

  • StringHelper

Index

Constructors

constructor

Properties

Static Private Readonly KILL_VERBS

KILL_VERBS: string[] = ...

Verbs used in the killfeed. Example usage:

  • Player1 killed Player2
  • Player1 eradicated Player2
  • Player2 sniped Player1

Methods

Static padLeadingZeros

  • padLeadingZeros(num: number, len: number): string
  • Pad a number with zeros.

    Parameters

    • num: number

      The number to pad

    • len: number

      The final length the padded string (number) should have

    Returns string

    padded string

Static randomKillVerb

  • randomKillVerb(): string

Static truncateString

  • truncateString(input: string, maxLength: number): string
  • Truncates a string to a given length, adding '...' on its tail, but only if the length exceeds the maximum value.

    Parameters

    • input: string

      Input string

    • maxLength: number

      Maximum string length

    Returns string

    Truncated string if too long, or original string if length checks out.

Generated using TypeDoc