Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Thread Tools Search this Thread
Old 13-07-2009
Join Date: May 2009
Posts: 11
vb.net multiline string

Hello to All ,
Is there a way to have multiline strings in VB.NET , Does anyone know how to split your code up on multiple lines ,

I want to enter something like

dim s as string = "This is me"

but instead of "this is me " I want to enter a multiline string. like this way

please Tell me How can i do so ? Thanks in advance
Reply With Quote
Old 13-07-2009
Join Date: Dec 2008
Posts: 24
Re: vb.net multiline string

insert a Underscore on the line is the last words ,And Start the next line with & character

For example
Public = "SELECT * From table1" _
& "FROM table2" _
& "WHERE (empid=id)";
Reply With Quote
Old 13-07-2009
Join Date: May 2008
Posts: 2,008
Re: vb.net multiline string

The underscore character has been used since (always) in the Visual Basic language will no longer be exploited in some cases, its presence and especially functionality will be deducted from implicitly by the compiler. Although it can still be exploited and was not removed from the language, the intention of the Visual Basic team is to enable any developer to no longer be obliged to employ the vast majority lines of code they write!

The underscore is thus implicit in the following cases:
  • After an attribute
  • After a comma
  • After a period (eg for method invocation)
  • After a binary operator
  • After a LINQ query clause
  • After (, (, or <% =
  • Front),), or%>
Reply With Quote
Old 13-07-2009
Join Date: Apr 2008
Posts: 1,948
Re: vb.net multiline string

VB.Net Does Not Seem to such feature and it is Expected to release in Visual Studio 2010. The feature you are referring might called as implicit line continuation.

Example for multiline string

Visual Studio 2008
Dim x = "line1" & vbCrlf & _

Visual Studio 2010
Dim x = "line1" & vbCrlf &
Reply With Quote

  TechArena Community > Software > Software Development
Tags: ,

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Similar Threads for: "vb.net multiline string"
Thread Thread Starter Forum Replies Last Post
Multiline screen fault in Sony Bravia KDL-32D3000 TV ElroyDJ Monitor & Video Cards 9 14-01-2012 02:21 AM
How to Manipulate String using PHP String Functions ComPaCt Software Development 3 21-09-2009 09:07 AM
How to convert string to int Zavier Software Development 3 04-06-2009 06:24 PM
PHP: array to string? Diwakar_12 Software Development 4 13-04-2009 02:44 PM
Set maxlength property on multiline textbox in Asp.net Miss Kelly Software Development 2 17-01-2009 05:57 PM

All times are GMT +5.5. The time now is 06:40 AM.