Operations for working with strings that contain text.
export declare class Text
The utilities provided by this class are intended to be simple, small, and very broadly applicable.
|convertTo(input, newlineKind)||Converts all newlines in the provided string to use the specified newline type.|
|convertToCrLf(input)||Converts all newlines in the provided string to use Windows-style CRLF end of line characters.|
Converts all newlines in the provided string to use POSIX-style LF end of line characters.
POSIX is a registered trademark of the Institute of Electrical and Electronic Engineers, Inc.
|ensureTrailingNewline(s, newlineKind)||Returns the input string with a trailing |
|escapeRegExp(literal)||Escapes a string so that it can be treated as a literal string when used in a regular expression.|
|getNewline(newlineKind)||Returns the newline character sequence for the specified |
|padEnd(s, minimumLength, paddingCharacter)||Append characters to the end of a string to ensure the result has a minimum length.|
|padStart(s, minimumLength, paddingCharacter)||Append characters to the start of a string to ensure the result has a minimum length.|
|replaceAll(input, searchValue, replaceValue)||Returns the same thing as targetString.replace(searchValue, replaceValue), except that all matches are replaced, rather than just the first match.|
|truncateWithEllipsis(s, maximumLength)||If the string is longer than maximumLength characters, truncate it to that length using "..." to indicate the truncation.|