|
-
Jul 8th, 2004, 11:47 AM
#1
Thread Starter
Addicted Member
Cleaning a string
I'm reading in a string from a database, but there are non-printing characters that are being read in that cause problems elsewhere.
I thought it was just a newline, but the following didn't work:
string theString = "junk read in from database";
theString.Replace("\n", "");
//This didn't work either:
theString.Replace(Environment.NewLine, "");
Since those don't work, I can only assume that there are other types of characters in the string. Is there a simple way to fix the string, or do I just need to write a loop going through the string one character at a time? What about regexp?
cudabean
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|