Results 1 to 4 of 4

Thread: vb.net multiline string

  1. #1
    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
    This
    is
    me

    please Tell me How can i do so ? Thanks in advance

  2. #2
    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)";

  3. #3
    Join Date
    May 2008
    Posts
    2,012

    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%>

  4. #4
    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 & _
    "line2"

    Visual Studio 2010
    Dim x = "line1" & vbCrlf &
    "line2"

Similar Threads

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

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,300,685.41900 seconds with 17 queries