String utility class extension.
Type | Description | |
alphaNumericStr | String |
Return upper number, lower and upper case english character string. |
englishKeyboardStr | String |
Return all character string on the english keyboard. |
lowerCaseStr | String |
Return lower case english character string - "abcdefghijklmnopqrstuvwxyz". |
lowerCaseStr | String |
Return upper case english character string - "ABCDEFGHIJKLMNOPQRSTUVWXYZ". |
lowerCaseStr | String |
Return upper lower and upper case english character string. |
numericStr | String |
Return numeric string - "0123456789". |
specialStr | String |
Return special character string on the english keyboard. |
Return type | Description | |
format(formatitems) | String |
Format string using numbered replacement fields {number}. The replacement strings will replace the numbered replacement fields. |
isNotEmpty(str) | Boolean |
Check if string is not empty. |
isNullOrEmpty(str) | Boolean |
Check if string is null or empty. |
JSONformat(formatitem) | String |
Format string using named replacement fields {key}. The replacement keys are matched and replacement values will replace the named replacement fields. |
replaceAt(strindexcharacter) | String |
Replace character in the string at specified index. |
reverse(str) | String |
Reverse original string. |
Format string using numbered replacement fields {number}. The replacement strings will replace the numbered replacement fields.
stringUtil.format('{0} is dead, but {1} is alive! {0} {2}', 'ASP', 'ASP.NET');
//output : ASP is dead, but ASP.NET is alive! ASP {2}
Check if string is not empty.
<String>
str
|
Required |
string to check. |
Check if string is null or empty.
<String>
str
|
Required |
string to check. |
Format string using named replacement fields {key}. The replacement keys are matched and replacement values will replace the named replacement fields.
stringUtil.JSONFormat('My name is {name}, I am {age} years old.', {name:'Bob', age:22});
//output : My name is Bob, I am 22 years old.
Replace character in the string at specified index.
stringUtil.replaceAt('Hello World!', 2, '123');
//output : He123lo World