Solved

How do you skip a line in a vb.net string?

Posted on 2010-11-08
2
405 Views
Last Modified: 2012-06-27
The question I have is pretty simple, how do you skip a line in a vb.net string?  I want it to appear that a return button was pressed while I am building the string.  Thanks!
0
Comment
Question by:VBBRett
2 Comments
 
LVL 3

Accepted Solution

by:
paul_p_vargas earned 250 total points
ID: 34090595
if you want to display it in windows form, it should be this:

myString = "This is my 1st line: " & vbnewline & "this is my 2nd line"
msgbox(myString)

if you want to display it in the web,

myString = myString = "This is my 1st line: <br/> this is my 2nd line"
response.write(myString)

i hope this is what you meant. :)
0
 
LVL 10

Assisted Solution

by:joriszwaenepoel
joriszwaenepoel earned 250 total points
ID: 34090670
I usually use the built-in constant vbCrLf for moving to a new line when building a string.

dim str as string = "Line 1" & vbcrlf & "Line2 & vbcrlf & "Line 3"
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

757 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

21 Experts available now in Live!

Get 1:1 Help Now