View Full Version : Replacing Characters?
How can I replace A-Z with out having a huge list of Replace's?
any idea?
Mat
I don't get it, what exactly you want to replace?
E: if you want to replace any capital letter then you can use
ReplaceRegExpr('[A-Z]',InputString,Replacement,TRUE );
example :
program new;
var
s :string ;
begin
s:='AbCd54%6464LKP';
s :=ReplaceRegExpr('[A-Z]',s,' +ReplaceWith+ ',TRUE );
writeln(s);
end.
+ReplaceWith+ b +ReplaceWith+ d54%6464 +ReplaceWith+ +ReplaceWith+ +ReplaceWith+
Coh3n
03-18-2012, 12:04 AM
Use a loop to go through each letter, checking if it's in a given string.
Thanks Begin, also how can I remove all the lines? as it now has a huge amounts of enters down, I tried ' ' and it doesn't work? any ideas <3
Mat
Thanks Begin, also how can I remove all the lines? as it now has a huge amounts of enters down, I tried ' ' and it doesn't work? any ideas <3
Mat
Can you post example?
Here:
##
All the enters I can't seem to remove them.
You can search for carriage return ( ASCII code #13#10) :
program new;
var
s :string ;
begin
s:='AbCd54%6464L'+#13#10+'nextLine'+#13#10+'dsdsd' +#13#10+'fdsfs';
writeln(s);
s:=ReplaceRegExpr('\x0D\x0A',s,'{++}',TRUE );
writeln('NewString:');
writeln(s);
end.
Thanks Man working great<3
+Rep <3
Mat
Powered by vBulletin® Version 4.2.1 Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.