Documentation
Back to website >

Trim (Pascalscript)

Description

Trim removes all blanks and control characters at the beginning and end of a string.

Syntax

function Trim(const S: string): string;

Arguments

Trim removes all blanks and control characters at the beginning and end of the string specified with S.

Excample

var
  S1: String;
  S2 : String;
begin
  S1:='   Hallo hier bin ich   ';
  S2:=Trim(S1);
  ShowMessage(S2);
end;

Rules to understand the script can be found here.

The Trim function removes all non-printable characters at the beginning and end of S1 and assigns the result to variable S2.

ShowMessage shows:'Hallo hier bin ich'