What´s a "carraige" ??
Main Topics
Browse All TopicsI have an application that gets CPU information, saves it into a string and wirtes in into text file. But in a certain CPU it´s reading some trash (unknown caracters) and I don´t want to write that in the text file. Below the string that it´s giving me:
AMD Athlon(tm) XP 2600+¶
It´s that last caracter that I wanto to take off before writing to the text file. I can´t just allways take the last caracter out because not all CPU information comes with that caracter. How and what is the best way of taking invalid caracters like that "¶" from my string ??? Thanks
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Carriage return sorry mispelled. This is basically a line feed, like when u press enter in word to move down a line.
That is the charater you see when u press the button "show/hide ¶"
In delphi it is a combination of #10#13 I think, or might just be #10 or #13 I cant remember.
You would need to change the function to replace that instead
MyString := StringReplace(MyString, #10#13, '', [rfReplaceAll])
or
MyString := StringReplace(MyString, #10, '', [rfReplaceAll])
Attacking this problem from the other end... Instead of getting rid of certain characters ... surely it would be better to only keep characters that you want ... see the function below
Function CleanStr(temp: string): string;
var
K: integer;
begin
for K:= length(temp) downto 1 do // work backwards to avoid indexing issues
Begin // you may want to change this part to add more characters
If not (temp[K] in ['A'..'Z','a'..'z','0'..'9
delete(temp,K,1)
end;
result:= temp
end;
// usage
procedure TForm1.Button1Click(Sender
begin
edit1.text:= CleanStr(edit1.Text);
end;
lol indeed thanks :
Function CleanStr(temp: string): string;
var
K: integer;
begin
for K:= length(temp) downto 1 do // work backwards to avoid indexing issues
Begin // you may want to change this part to add more characters
If not (temp[K] in ['A'..'Z','a'..'z','0'..'9
delete(temp,K,1)
end;
result:= temp
end;
Business Accounts
Answer for Membership
by: mikelittlewoodPosted on 2005-09-28 at 05:38:48ID: 14974213
Is it a character or a carraige return?
If it is a character then
MyString := StringReplace(MyString, '¶', '', [rfReplaceAll])