procedure RightTrim32(var Str: String);
var
SPos,SLen: Integer;
begin
Spos := Length(Str);
if Str[SPos] = ' ' then
begin
SLen := 0;
while (SPos > 0) and (Str[SPos] = ' ')
do
begin
Inc(SLen);
Dec(SPos)
end;
Delete(Str,SPos+1,SLen);
end
end;
$string =~ s/ +$//;
Free libs... (Score:2, Informative)
FYI, doing a quick google, i found a free regex lib for Delphi, here [latiumsoftware.com].
*shrug*
Bug? (Score:1)
Re:Bug? (Score:1)
Re:Bug? (Score:1)
But whats wrong with the Delphi implemented TrimRight() function:
> MyString TrimRight(MyString)
Of course I admit that Perl is better at Text processing. But, opposed to Perl, Delphi intended as a Language to make the creation of Windows, event driven GUI's easy.
Not to make it easy to transform one bunch of ASCII-characters into another bunch of ASCII-characters.
Re:Bug? (Score:1)