Overview
/
KCL Standard Library
/
Functions
/
string::trim

string::trimFunction in std::string

Remove whitespace from the start and end of a string.

Whitespace is defined by Unicode's White_Space property and includes spaces, tabs, newlines, and non-breaking spaces. Whitespace inside the string is preserved.

If the input is empty or contains only whitespace, this returns an empty string. Unicode normalization and case conversion are not performed.

Arguments

NameTypeDescriptionRequired
textstringThe string to trim.Yes

Returns

string - A sequence of characters

Examples