Solved

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

Posted on 2010-11-08
2
409 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
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…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

680 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