HP Pascal/iX Reference Manual (31502-90022)

9- 12
writeln (strlen(ars):2,strlen(vita):2);
END.
Output:
5 6
strltrim
Usage
strltrim
(s)
Argument
s
A string expression.
Description
The function strltrim
(s)
returns a string consisting of
s
trimmed of all
leading blanks. The function strrtrim trims trailing blanks.
Example
VAR
s: string[80];
BEGIN
.
s:= ' abc';
s:=strltrim(s); {s is now 'abc'}
. {strlen(s) = 3 }
END.
strmax
Usage
strmax
(s)
Argument
s
A string variable.
Description
The function strmax
(s)
returns the maximum length of
s
. Strmax is useful
for finding the maximum length of VAR string parameters whose maximum is
not determined until run time.
Example
VAR
s: string[15];
BEGIN
s:= ' ABCDE ';
IF strlen(s) = strmax(s) THEN
BEGIN
s:= strltrim(s);
s:= strrtrim(s);
END;
writeln (s,strmax(s):3);
.
END.
Output: