-
Notifications
You must be signed in to change notification settings - Fork 6
String
LordMidas edited this page Aug 15, 2024
·
8 revisions
File path: scripts/config/msu/string.nut
::MSU.String.capitalizeFirst( _string )
// _string is a stringReturns _string with the first character capitalized.
::MSU.String.replace( _string, _find, _replace, _all = false )
// _string, _find and _replace are strings
// _all is a booleanReturns _string with the first instance of _find replaced with _replace.
If _all is true, replaces every instance of _find with _replace.
::MSU.String.isInteger( _string )
// _string is a stringReturns true if _string can be losslessly cast to an integer.
This handles leading 0s and other edge cases correctly,
unlike something like string == string.tointeger().tostring().
Returns false otherwise.
::MSU.String.startsWith( _string, _start )
// _string and _start are stringsReturns true if string starts with _start, otherwise returns false.
::MSU.String.endsWith( _string, _end )
// _string and _start are stringsReturns true if string ends with _end, otherwise returns false.
- NOTE: MSU guarantees backwards compatibility for documented features and code only. Undocumented features/code of MSU may be changed at any time without notice, so we advise against using/referencing such code in your projects.
- For bug reports or feature requests, please create issues.
- If you would like to join the team, write to us at msu.team@protonmail.com.