import { StringUtil } from "https://deno.land/x/tstl@v3.0.0/benchmark/internal/StringUtil.ts";
Static Methods
Generate a substring.
Extracts a substring consisting of the characters from specified start to end. It's same with str.substring( ? = (str.find(start) + start.size()), str.find(end, ?) )
const str: string = StringUtil.between("ABCD(EFGH)IJK", "(", ")");
console.log(str); // PRINTS "EFGH"
- If start is not specified, extracts from begin of the string to end.
- If end is not specified, extracts from start to end of the string.
- If start and end are all omitted, returns str, itself.
Fetch substrings.
Splits a string into an array of substrings dividing by specified delimeters of start and end. It's the array of substrings adjusted the between.
Remove all designated characters from the beginning of the specified string.
Number to formatted string with "," sign.
Returns a string converted from the number rounded off from specified precision with "," symbols.
Replace all HTML spaces to a literal space.
Repeat a string.
Returns a string consisting of a specified string concatenated with itself a specified number of times.
Returns a string specified word is replaced.
Returns a string specified words are replaced.
Remove all designated characters from the end of the specified string.
Substitute {n}
tokens within the specified string.
Substitute {n}
tokens within the specified SQL-string.
Remove all designated characters from the beginning and end of the specified string.