Trim

From Bennu Wiki
Revision as of 05:58, 9 March 2009 by Sandman (talk | contribs) (New page: Category:functions Category:strings Category:mod_string ==Definition== '''STRING''' trim ( <'''STRING''' str> ) Returns a copy of ''str'' without leading or ending whitespace...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search


Definition

STRING trim ( <STRING str> )

Returns a copy of str without leading or ending whitespace (spaces, tabs, linefeeds, carriage returns).

Parameters

STRING str - The string to trim.

Returns

STRING: trimmed string

Example

import "mod_string"
import "mod_say"

Const
    _ABC_ = " ABC ";
End

Process Main()
Private
    string ABC;
Begin

    ABC = trim(_ABC_);
    say('_ABC_ = "' + _ABC_ + '"');
    say('ABC = "' + ABC + '"');

End

Used in example: say(), trim()

Result:

_ABC_ = " ABC "
ABC = "ABC"


Mod_string
Functions Asc()Atof()Atoi()Chr()Find()Format()Ftoa()Itoa()Lcase()Len()Lpad()Rpad()Strcasecmp()Strlen()Strrev()Substr()Trim()Ucase()