You are correct in that if it is passed to MessageBox.Show as a hard coded
string it will do as I would like. The issue is that I'm putting all my
messages in a resource file so they can be changed without rebuilding the
application. So when the resource is read by the ResourceManager it is read
as a quoted string.
Thanks
Ken
"Jeffrey Tan[MSFT]" <v-jetan@online.microsoft.com> wrote in message
news:9l0xLDYgDHA.688@cpmsftngxa06.phx.gbl...[color=blue]
>
> Hi Ken,
>
> Can you show me why you need the \n\n to be parsed?
> If you want to display it such as in messagebox, you can
> just pass this string to the method, it will be parsed.
> MessageBox.Show("This is line1\n\nThis is line 2"), the string
> will be parsed.
>
> Btw: \n\n is 2 newline escape character.
>
> Best regards,
> Jeffrey Tan
> Microsoft Online Partner Support
> Get Secure! -
www.microsoft.com/security
> This posting is provided "as is" with no warranties and confers no rights.
>
> --------------------
> | From: "Ken" <kdenault@charter.net>
> | Newsgroups: microsoft.public.dotnet.languages.csharp
> | Subject: Escape Sequences in Strings
> | Date: Mon, 22 Sep 2003 18:01:06 -0400
> | Organization: Posted via Supernews,
http://www.supernews.com
> | Message-ID: <vmus8u64r1ok64@corp.supernews.com>
> | X-Priority: 3
> | X-MSMail-Priority: Normal
> | X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
> | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
> | X-Complaints-To:
abuse@supernews.com
> | Lines: 16
> | Path:
>[/color]
cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed 00.sul.t-online.de!t-onlin[color=blue]
>[/color]
e.de!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!sn-xit-03!sn-xit-01!sn-[color=blue]
> post-01!supernews.com!corp.supernews.com!not-for-mail
> | Xref: cpmsftngxa06.phx.gbl[/color]
microsoft.public.dotnet.languages.csharp:186644[color=blue]
> | X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
> |
> | HI:
> |
> | I'm reading a string that will be displayed in a MessageBox from a
> resource
> | file. The string in the resource file contains escape sequences so they
> | will be broken up into multiple lines. e.g. This is line 1\n\nThis is
> line
> | 2. When this string is read using a ResourceManager GetString method[/color]
the[color=blue]
> | string is returned @-quoted, i.e as if I entered the literal @"This is
> | line1\n\nThis is line 2", causing the escape sequences not to be
> processed.
> | Is there any way around this. I have not been able to find a work[/color]
around[color=blue]
> or
> | setting that can be used so the escape sequences will be processed.
> |
> | Thanks in advance
> |
> | Ken Denault
> |
> |
> |
>[/color]