/
Trimming white space

Trimming white space

Try this code in the Translator:

local Life = " This is life "; Life = Life:trimWS()

You’ll see something like this:

The function trims white space from either side of the string. It’s important to know that stripped string is returned - Lua strings are ‘immutable’. Once created they cannot be altered - you can point a variable at a new string.

Related content

# Operator on Strings
# Operator on Strings
Read with this
Immutable Strings
Immutable Strings
More like this
Make a Custom File Reader
Make a Custom File Reader
Read with this
String:match()
String:match()
More like this
Custom Status
Read with this
Variables
More like this