Solved

Newline character within ASP String

Posted on 2004-04-08
3
532 Views
Last Modified: 2008-02-01
How do i add a Newline between two strings

x="Hi"
y="Heehee"

response.write "x" & "y"
output: hiheehee

but what i want is
hi
heehee

Please advice. Thanks for your help.

0
Comment
Question by:Shelmina_Shivji
  • 2
3 Comments
 
LVL 11

Expert Comment

by:griessh
ID: 10786130
Hi Shelmina_Shivji,

something like:

var newline
newline="\n"
response.write "x"+newline+"y"




======
Werner
0
 
LVL 1

Expert Comment

by:stephenmmitchell
ID: 10786535
You need this:

x="Hi"
y="Heehee"

response.write "x" & vbCrLf & "y"

output:
Hi
Heehee

The "vbCrLf" is built into VBScript for a line break.

Hope this helps
0
 
LVL 1

Accepted Solution

by:
stephenmmitchell earned 50 total points
ID: 10786547
However, if you are trying to output this to HTML, you will need to do something like this.

x="Hi"
y="Heehee"

response.write "x" & "<br>" & "y"

output (in HTML):
Hi
Heehee

I think the first answer is what you are looking for though.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
what font behind pdf 32 128
How to connect Vivotek Camera from across the internet 2 61
Query Missing Money orders... 6 92
Rubber hose 5 75
Stuck in voice control mode on your Amazon Firestick?  Here is how to turn it off!!!
Gift cards are not a new concept - it's been around for a very long time.  Undoubtedly, over the past you have received such a card or purchased one for a friend or relative.  Are you aware that you've been feeding the machine?  If not, read on :)
The Bounty Board allows you to request an article or video on any technical topic, or fulfill a bounty request to earn points. Watch this video to learn how to use the Bounty Board to get the content you want, earn points, and browse submitted bount…
Saved searches can save you time by quickly referencing commonly searched terms on any topic. Whether you are looking for questions you can answer or hoping to learn about a specific issue, a saved search can help you get the most out of your time o…

912 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now