Top index Wirbel home

::strip

string.strip() - remove white space at right side
string.strip(string chars) - remove characters at both sides of string

string.strip() returns a copy of a with all white space at the beginning and end of a removed.

string.strip(string chars) removes all characters appearing in chars at the beginning and at the end of astring. astring it not modified, a copy is returned.

Examples

 "-*- hello -*-".strip("-* ") == "hello"

See also

lstrip, rstrip