By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,691 Members | 1,123 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,691 IT Pros & Developers. It's quick & easy.

Removing various forms of line breaks

P: n/a
Im having trouble removing line breaks from my c# string. Actually, im
having trouble getting .Trim() to work properly, as it seems to count
a string that has nowt but a break of some sort as not being empty.
To get trim to work properly im trying to axe out the line breaks
seperately. Ive got .replace("/r") and "/n" but still having problems
with some strings. Are there paragraph markers or something I should
be removing too? how do i specify to remove them?
Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
Nov 22 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Depending on the source of the string, the line breaks could be different
without having the actual content; it is hard to determine your exact
problem.

First, a string that has any bytes is not empty. Lines breaks are bytes,
therefore the string will of coarse not be empty.

Looks at the strings in the debugger watch window and you should see all
characters represented as something.
"ChrisC" <ch************@hotmail-dot-com.no-spam.invalid> wrote in message
news:40**********@Usenet.com...
Im having trouble removing line breaks from my c# string. Actually, im
having trouble getting .Trim() to work properly, as it seems to count
a string that has nowt but a break of some sort as not being empty.
To get trim to work properly im trying to axe out the line breaks
seperately. Ive got .replace("/r") and "/n" but still having problems
with some strings. Are there paragraph markers or something I should
be removing too? how do i specify to remove them?
Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com

Nov 22 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.