473,385 Members | 1,356 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,385 software developers and data experts.

New line in string, \n not working

Hi,

I have the following string written in c#:

string strAddressAll = strAddress1 + ",\n" + strAddress2 + ",\n" +
strAddress3 + ",\n" + strCountry + ",\n" + strPostcode;

But it all appears on one line?

I've also tried adding in :

+ System.Environment.NewLine

but that didn't work either??

Any ideas what's going on?

Thanks

Nov 17 '05 #1
5 62361
Where do you display the text? Maybe control is not multiline or smth like
this.
Or complete CRLF combination will do?

FYI CRLF ( carriage return line feed ) - \r\n :)

--
Vadym Stetsyak aka Vadmyst

"Assimalyst" <c_******@hotmail.com> wrote in message
news:11**********************@g44g2000cwa.googlegr oups.com...
Hi,

I have the following string written in c#:

string strAddressAll = strAddress1 + ",\n" + strAddress2 + ",\n" +
strAddress3 + ",\n" + strCountry + ",\n" + strPostcode;

But it all appears on one line?

I've also tried adding in :

+ System.Environment.NewLine

but that didn't work either??

Any ideas what's going on?

Thanks

Nov 17 '05 #2
What are you using to display the string strAddressAll?

If you are using a TextBox, be sure that you have set it’s MultiLine
property to true.

Brendan
"Assimalyst" wrote:
Hi,

I have the following string written in c#:

string strAddressAll = strAddress1 + ",\n" + strAddress2 + ",\n" +
strAddress3 + ",\n" + strCountry + ",\n" + strPostcode;

But it all appears on one line?

I've also tried adding in :

+ System.Environment.NewLine

but that didn't work either??

Any ideas what's going on?

Thanks

Nov 17 '05 #3
I'm using it to set a Label.Text, it dosen't seem to have a multiline
option.

Thanks

Nov 17 '05 #4
Hi,

Nop, a Label does not have it, depending of the sizse of the label it does
include the new line.

You could either use more than one label (not good) or try to justify the
text with whitespaces (better idea)

cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"Assimalyst" <c_******@hotmail.com> wrote in message
news:11*********************@g47g2000cwa.googlegro ups.com...
I'm using it to set a Label.Text, it dosen't seem to have a multiline
option.

Thanks

Nov 17 '05 #5
Thanks, I'll give that a go.

Nov 17 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

19
by: linzhenhua1205 | last post by:
I want to parse a string like C program parse the command line into argc & argv. I hope don't use the array the allocate a fix memory first, and don't use the memory allocate function like malloc....
2
by: | last post by:
I need to assign a multiline string to a textbox in design time, my problem is that strings cannot be on more than one line in the editor, even the _ at the end of a line doesn't work with string,...
3
by: mrspinelli | last post by:
I have this following code: x= tempStr.IndexOf((char)13, 0); The string tempSTR = " Heading" Notice that their is a Carriage Return and/or line feed before the stirng value of "heading?"...
5
by: dean | last post by:
sSQL = " update SELECTED_NODES " " set LABEL_S = 'Y' " " where NODE_I in " " ( " " select NODE_I " " from " " ( " " select ONODE_I NODE_I from link " " union all "
0
by: Foevrnite | last post by:
Hi Guys, Does anybody see a problem with this line of code??? <CONDITION> Frac(Entry.Quantity * 100) = 0.0 </CONDITION> for some reason, i cannot ge this to equal true with input such as...
4
by: Jason | last post by:
I have a string that looks like this? ihelloworld_zzz_yyy In a single vb.net line, I want to remove the frist character and anything after and including the first "_" resulting in : ...
2
by: garyusenet | last post by:
I have a multi line text box, i'd like to store the contents of this textbox to a text file. However when I write the value of ' textbox.text ' to the file it is written verbatim spanning many...
0
by: ilcil | last post by:
I was looking for information on how to have strings cross multiple lines in asp.net a result came up from google from this site, but it was an unanswered question from the newsgroup archives. I...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.