Re: Embedding a newline in a vb.net string constant

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



"Andrew Backer" <awbacker@xxxxxxxxx> schrieb:
Is it possible to embed a newline constant in a string in the same way
as c#? I really don't want to do something like this:
++ String.Format("Line 1 : {0} " & vbcrlf & " Line 2 : {1}", o, t)

What's the problem? The code is functionally completely equivalent to the C# code if "\r\n" is embedded into the literal in the source code. Note that the concatenation can be performed by the compiler because 'vbCrLf' is a constant!

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

.



Relevant Pages

  • Re: Progress Bar - Basic Question
    ... M S Herfried K. Wagner ... "Keith Rebello" schrieb im Newsbeitrag ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Erase a specific line in a *.txt file
    ... "Larry Serflaten" schrieb: ... > To erase data from a file, you have to build a new file with the desired ... timestamp will change. ... Herfried K. Wagner ...
    (microsoft.public.dotnet.languages.vb)
  • Re: COM-Steuerelement erstellen
    ... > Hallo Christian! ... >> einsetzen kann? ... > M S Herfried K. Wagner ...
    (microsoft.public.de.german.entwickler.dotnet.vb)
  • Re: Add question mark to title bar
    ... "Carlos Sosa Albert" schrieb: ... 'WndProc' will do the trick. ... M S Herfried K. Wagner ...
    (microsoft.public.dotnet.framework.windowsforms)
  • Re: Use an image that I have "attached" to the project
    ... "Ulf Christenson" schrieb: ... If you want to keep the image a separate file, make sure you set its build action appropriately, in order to get the image copied to the destination folder. ... M S Herfried K. Wagner ...
    (microsoft.public.dotnet.languages.vb)