Trimming whitespaces


It's been a long while since I used LScript, but looking at the docs it seems that there is no direct way of doing it, there is no trim function. However, a combination of strleft/strright and strsub should do the trick. I'm assuming we are talking about text strings... :)


Well-known member
<var>.pack() and <var>.trunc() should remove leading and trailing whitespace in lscript on strings.

var a ="   This is a string with leadiing and trailing white space.   ";
a = a.pack();
a = a.trunc(); // a should now be "This is a string with leading and trailing white space."
Last edited:
Top Bottom