This function removes spaces from string. It has a parameter n which allows you either choose to remove spaces from leading and trailing spaces from the string or remove all spaces, including those inside the string.
string Trim(string str$[, int n = 0])$
str
n
0 (default) | Trim leading and trailing spaces |
---|---|
1 | Trim all spaces, including those inside the string |
returns the string which spaces have been removed.
string str1$ = " abc ABC "; string newStr1$ =Trim(str1$,0)$ ; newStr1$ = ; //should be "abc ABC" string str2$ = " abc abc "; string newStr2$ = Trim(str2$,1)$; newStr2$ = ; //should be "abcabc"