On Wed, 22 Dec 2004 06:45:05 -0800, Christine wrote:
Okay that helps with the spaces, but now I have a problem of a carriage
return at the end of each line that Regex doesn't take care of. Is there
some way to take care of this as well as the multiple spaces? Thanks so much
for the help!
You have several options. You could use the System.String.Replace method
to replace the carriage return with an empty string, or you could use
System.String.TrimEnd - Ex:
string newString =
stringWithCarriageReturn.TrimEnd(new char[]{'\r','\n',' '});
Note that the above will also trim any trailing spaces.
--
Tom Porterfield