User manual
592
mikoPascal PRO for PIC32
MikroElektronika
ltrim
rtrim
strappendpre
strappendsuf
length
Prototype
procedure ltrim(var astring : string);
Description The procedure trims the leading spaces of the string.
Example
txt := ‘ mikroE’;
ltrim(txt); // trims the leading 2 spaces of the ‘txt’ string
Prototype
procedure rtrim(var astring : string);
Description The procedure trims the trailing spaces of the string.
Example
txt := ‘mikroE ‘;
rtrim(txt); // trims the trailing 2 spaces of the ‘txt’ string and adds
terminating null character to the result
Prototype
procedure strappendpre(letter: char; var s1 : string);
Description The procedure appends character at the beginning of the string.
Example
txt := ‘ikroE’;
strappendpre(‘m’,txt); // adds letter ‘m’ at the beginning of the ‘txt’
string
Prototype
procedure strappendsuf(var s1 : string; letter : char);
Description The procedure appends character at the end of the string.
Example
txt := ‘mikro’;
strappendsuf(‘E’,txt); // adds letter ‘E’ at the end of the ‘txt’ string
Prototype
function length(var s: string) : word;
Description The function returns length of passed string.
Example
txt := ‘mikroE’;
res = length(txt); // calculates and returns the length of the ‘txt’ string