Easiest solution that comes to mind is defining a regular expression that returns the input string minus any non-alpha characters in it.
jwenting
2010-03-16 06:05:55
Easiest solution that comes to mind is defining a regular expression that returns the input string minus any non-alpha characters in it.
It's been a while since I did much with Delphi - version 5 was my playground.
Isn't one of the primary features of Delphi 2009 that it's now Unicode throughout, by default.
This has impact on anything that tries to process character by character. Could it be the source of your problem?
Uses StrUtils; //StuffString
var
Regex: TPerlRegEx;
I:Integer;
begin
Regex := TPerlRegEx.Create(nil);
Regex.RegEx := '[^[:alnum:]]';
Regex.Options := [preMultiLine];
Regex.Subject := data;
if Regex.Match then begin
repeat
data := StuffString(data,Regex.MatchedExpressionOffset,Regex.MatchedExpressionLength,' ');
until not Regex.MatchAgain;
end;