Class StringTools
Hierarchy
- StringTools
Index
Methods
Static DecodeSearch playground for Decode
-
Decodes a buffer into a string
Parameters
-
buffer: Uint8Array | Uint16Array
The buffer to decode
Returns string
The decoded string
-
Static Encode Array Buffer ToBase64Search playground for EncodeArrayBufferToBase64
-
Encode a buffer to a base64 string
Parameters
-
buffer: ArrayBuffer | ArrayBufferView
defines the buffer to encode
Returns string
the encoded string
-
Static Ends WithSearch playground for EndsWith
-
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 Pad NumberSearch playground for PadNumber
-
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 Starts WithSearch playground for StartsWith
-
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)
-
Helper to manipulate strings