From Clomosy Docs

Revision as of 13:53, 24 December 2024 by ClomosyAdmin (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Trims leading and trailing spaces and control characters from a string.
Trim removes leading and trailing spaces and control characters from the given string S.

Use TrimLeft or TrimRight to limit the operation to just one end of the string.

Example

const
  textValue = '      Letters     ';
{
  ShowMessage('/'+TrimLeft(textValue)+'/');
  ShowMessage('/'+TrimRight(textValue)+'/');
  ShowMessage('/'+Trim(textValue)+'/');
}

Output:

See Also