Library globals

Function globals . string . trim

View source

trim spaces at the left (lr < 0), at the right (lr > 0), or both (lr = 0)
An optional function argument defines which characters should be trimmed:

string.trim(a);                                    # trim spaces
string.trim(a, 1, string.isdigit);                 # trim digits at the right
string.trim(a, 0, func(c) c == `\\` or c == `/`);  # trim slashes/backslashes

Parameters

s

lr
optional

istrim
optional