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

Tech-Archive recommends: Speed Up your PC by fixing your registry




Herfried K. Wagner [MVP] wrote:
<zacks@xxxxxxxxxxxxxxxxxxxxxxxx> 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)
when I should be able to do
++ String.Format("Line 1 : {0}\nLine2 : {2}", o, t)

Not the best example, I am sure, but it does get worse in many cases?
So, is there a way to do this in vb, or am I stuck? I have tried
googling but I can't find anything.

The only way I can think of is:

String.Format("Line 1 : {0}{1}Line2 : {2}", o, vbcrlf, t)

This solution is even worse because one additional concatenation needs to be
performed at runtime!

I agree, I was just trying to show the OP the futility in his request.

.



Relevant Pages

  • Re: Function return values revisited
    ... Microsoft isn't always clear about what answer to give, ... they noted the request. ... Herfried K. Wagner [MVP] ...
    (microsoft.public.dotnet.languages.vb)
  • Re: MVPs and Terminal Services
    ... That's a valid request. ... recommend, so I often begin answer their question with a question to figure ... Microsoft MVP - Terminal Server ... the client of the actual features and limitations so the client isn't ...
    (microsoft.public.windows.terminal_services)
  • Re: Displaying Live data from Access.mdb ?
    ... "Brian Reilly, MVP" wrote: ... No native way to Link but this solves the Insert request. ... look into Tags on PPT shapes. ... solution except 3rd party software apps that link from CSV files or Excel, ...
    (microsoft.public.powerpoint)
  • Re: Help me please: Clipart crashing
    ... your update level of OS X is way behind? ... Bob Jones ... [MVP] ... Please understand that the request for this information isn't being made out ...
    (microsoft.public.mac.office.powerpoint)
  • Re: mailto
    ... extended by Herfried K. Wagner [MVP]: ... Imports System.Diagnostics ... Public Sub StartDefaultMail(_ ...
    (microsoft.public.de.german.entwickler.dotnet.vb)