467,173 Members | 1,394 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,173 developers. It's quick & easy.

Literal and linebreak

Hi, is it possible to have Literal using linebreaks? If i have a textfile
with more than 1 line then Literal take all on one line.

/Per W.
Nov 19 '06 #1
  • viewed: 1140
Share:
3 Replies
Per W. <pe**@tiscali.nowrote:
Hi, is it possible to have Literal using linebreaks? If i have a textfile
with more than 1 line then Literal take all on one line.
Could you try asking your question again in a different way? I'm not
entirely sure I understand. On the other hand, if you mean can you have
a string literal which includes linebreaks, then it definitely depends
on your language (at least in terms of how you do it).

In C#, for instance, you could use:

string verbatimLiteral = @"This text
is on
multiple lines";

or:

string normalLiteral = "This text\r\nhas linebreaks\r\nembedded";

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Nov 19 '06 #2

"Jon Skeet [C# MVP]" <sk***@pobox.comskrev i melding
news:MP************************@msnews.microsoft.c om...
Per W. <pe**@tiscali.nowrote:
>Hi, is it possible to have Literal using linebreaks? If i have a textfile
with more than 1 line then Literal take all on one line.

Could you try asking your question again in a different way? I'm not
entirely sure I understand. On the other hand, if you mean can you have
a string literal which includes linebreaks, then it definitely depends
on your language (at least in terms of how you do it).

In C#, for instance, you could use:

string verbatimLiteral = @"This text
is on
multiple lines";

or:

string normalLiteral = "This text\r\nhas linebreaks\r\nembedded";
Its VB. The only place i got linebreak from a textfile to work is in
textbox, in literal or a cell in a table i dont get the linebreaks. I read a
file with
My.Computer.FileSystem.ReadAllText(memolabel.Text,
System.Text.Encoding.ASCII)

/Per W.
Nov 19 '06 #3
On Sun, 19 Nov 2006 20:59:05 +0100, Per W. wrote:
"Jon Skeet [C# MVP]" <sk***@pobox.comskrev i melding
news:MP************************@msnews.microsoft.c om...
>Per W. <pe**@tiscali.nowrote:
>>Hi, is it possible to have Literal using linebreaks? If i have a textfile
with more than 1 line then Literal take all on one line.

Could you try asking your question again in a different way? I'm not
entirely sure I understand. On the other hand, if you mean can you have
a string literal which includes linebreaks, then it definitely depends
on your language (at least in terms of how you do it).

In C#, for instance, you could use:

string verbatimLiteral = @"This text
is on
multiple lines";

or:

string normalLiteral = "This text\r\nhas linebreaks\r\nembedded";

Its VB. The only place i got linebreak from a textfile to work is in
textbox, in literal or a cell in a table i dont get the linebreaks. I read a
file with
My.Computer.FileSystem.ReadAllText(memolabel.Text,
System.Text.Encoding.ASCII)

/Per W.
Per, this is not a purely ASP.NET newsgroup! Please tell people if you're
asking about WinForms or ASP.NET or most will assume WinForms.

A newline is represented by a <brin a Literal, just as it is in any HTML.

Cheers,
Gadget
Nov 19 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.

By using this site, you agree to our Privacy Policy and Terms of Use.