473,401 Members | 2,139 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,401 software developers and data experts.

Removing various forms of line breaks

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
1 1830
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Mechphisto | last post by:
I'm using a textarea to insert some notes into a database. It's inserting the complete result into the mySQL table including the linebreaks...and not as a visible symbol but an actual linebreak. If...
6
by: Aaron Collins | last post by:
Hello, i have a string that was entered in a web form and stored in a mysql database where the user entered carriage returns as well as <br>'s after each line in the form. the data is stored as...
1
by: ChrisC | last post by:
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...
0
by: James Fike | last post by:
Okay the wierdest thing has started happening to me. Everytime I use a MessageBox.Show in Debug Visual Studio breaks for a break point thats in the System.Windows.Forms.MessageBox.ShowCore...
4
by: intl04 | last post by:
I have a memo field that is included in some Access reports I created. Is there some way for the memo field to display nicely formatted text, with line breaks between paragraphs? Or is it necessary...
2
by: Mike | last post by:
I need my textbox to work more smoothly with respect to line breaks. When I have data pulled from the database into a textbox there are hard line breaks at the end of each line (by definition how...
18
by: mouseit101 | last post by:
I'm writing a program to emulate nuerons (can't spell for my life sorry) and am using an array of "mailboxes" to propagate messages through the network, but I need to be able to remove the request...
5
by: joelbyrd | last post by:
Didn't know exactly where to post this, but: How do I get line breaks in a textarea? I'm pulling text from a database, and this text definately has line breaks in it, because I replaced all the...
2
by: caspardh | last post by:
i was trying to code a morse code decipherer which workd fine except that the .txt file that i was converting had linebreaks built in, i cant get python to ignore the line breaks and i cant find any...
8
Chittaranjan
by: Chittaranjan | last post by:
Hi All, I am using perl to get the data from the form fields and I have a text area from where if some one enters data like below: "This is test And this is also test This is also test." ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.