Documentation
Back to website >

TrimRight (Pascalscript)

Description

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

Syntax

function TrimRight(const S: string): string;

Arguments

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

Excample

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

Rules to understand the script can be found here.

The text '    Hallo hier bin ich    ' is assigned to variable S1. The TrimRight function removes all non-printable characters at the end of S1 and assigns the result to variable S2.

ShowMessage shows:  '    Hallo hier bin ich'