Class: StringUtils ​
Defined in: packages/common/src/utils/string.ts:6
Utility class string-related operations.
Name ​
StringUtils StringUtils
Constructors ​
Constructor ​
new StringUtils():
StringUtils
Returns ​
StringUtils
Methods ​
chop() ​
staticchop(value):string
Defined in: packages/common/src/utils/string.ts:41
Remove the last character from a string.
Parameters ​
value ​
string
The string to chop.
Returns ​
string
The chopped string.
escapeRegExp() ​
staticescapeRegExp(value):string
Defined in: packages/common/src/utils/string.ts:12
Escape special characters in a string for use in a regular expression.
Parameters ​
value ​
string
The string to escape.
Returns ​
string
The escaped string.
replaceEnd() ​
staticreplaceEnd(value,pattern,replacement?):string
Defined in: packages/common/src/utils/string.ts:52
Replace the end of a string if it matches a given pattern.
Parameters ​
value ​
string
The string to modify.
pattern ​
The pattern to match at the end of the string.
string | RegExp
replacement? ​
string = ''
The replacement string.
Returns ​
string
The modified string.
toSnake() ​
statictoSnake(value):string
Defined in: packages/common/src/utils/string.ts:21
Convert a camelCase string to snake_case.
Parameters ​
value ​
string
The camelCase string to convert.
Returns ​
string
The converted snake_case string.
toSnakeScream() ​
statictoSnakeScream(value):string
Defined in: packages/common/src/utils/string.ts:32
Convert a string to SNAKE_SCREAMING_CASE.
Parameters ​
value ​
string
The string to convert.
Returns ​
string
The converted SNAKE_SCREAMING_CASE string.