Skip to main content

Strings

EndsWith

x.EndsWith(needle) -> boolean

Returns true if the string ends with the specified substring, otherwise false. If either or both parameters are nullish, returns false.

FormatWithDecimals

x.FormatWithDecimals(digits) -> string

Returns a string representation of the number with the specified number of decimal places. If digits is nullish, returns the number as a string with zero decimal places. If x is nullish, returns undefined.

FormatWithPrecision

x.FormatWithPrecision(precision) -> string

Returns a string representation of the number with the specified number of significant digits. If precision is nullish, returns the number as a string with 3 significant digits. If x is nullish, returns undefined.

Join

collection.Join(separator?) -> string

Returns a string that is the result of concatenating the elements of the collection with the specified separator. If collection is nullish, returns undefined. If separator is nullish, returns the elements of the collection concatenated with a comma and a space (, ).

LineBreak

LineBreak -> string

Returns a string containing a single line break character.

Split

x.Split(separator) -> array

Returns an array of strings that are the result of splitting the string at each occurrence of the specified separator. If x is nullish, returns undefined. If separator is nullish, no splitting occurs, and so an array containing the original string is returned.

StartsWith

x.StartsWith(needle) -> boolean

Returns true if the string starts with the specified substring, otherwise false. If either or both parameters are nullish, returns undefined.

Substring

string.Substring(from, length?) -> string

Returns a new String that is a substring of the original string.

  • from (Number): the substring will begin from the character at this index, where the first character is at position 0.
  • length (Number): the maximum number of characters to include in the substring. If more than the number of characters in the string, will just return the rest of the string. If length is not provided, the substring will include all characters from from to the end of the string.

If string is nullish, returned undefined.