U needs a 32 bit hex sequence:
using System;
namespace Test
{
class TestMain
{
public static void Main(string [] args)
{
string s = "\U00000061";
Console.WriteLine(s);
}
}
}
Cheers,
Paul.
>-----Original Message-----
>From: Unmoderated discussion of advanced .NET topics. [mailto:ADVANCED-
>[EMAIL PROTECTED] On Behalf Of John Elliot
>Sent: Tuesday, 6 July 2004 2:49 PM
>To: [EMAIL PROTECTED]
>Subject: Re: escaped string to char
>
>>from the spec:
>>
>>A Unicode character escape sequence represents a Unicode character.
>Unicode
>>character escape sequences are processed in identifiers (Section
>2.4.2),
>>character literals (Section 2.4.4.4), and regular string literals
>(Section
>>2.4.4.5). A Unicode character escape is not processed in any other
>location
>>(for example, to form an operator, punctuator, or keyword).
>>
>>unicode-escape-sequence:
>>\u hex-digit hex-digit hex-digit hex-digit
>>\U hex-digit hex-digit hex-digit hex-digit hex-digit
>hex-digit
>>hex-digit hex-digit
>
>
>From the .NET v1.1 C# compiler:
>
>------ Build started: Project: Test.CharParsing, Configuration: Debug
>.NET ------
>
>Preparing resources...
>Updating references...
>Performing main compilation...
>f:\work\test\test.charparsing\entrypoint.cs(27,18): error CS1009:
>Unrecognized escape sequence
>
>Build complete -- 1 errors, 0 warnings
>Building satellite assemblies...
>
>
>
>---------------------- Done ----------------------
>
> Build: 0 succeeded, 1 failed, 0 skipped
>
>--
>Pertinent lines from source:
>--
>
>27. String s = "\U0000";
>28. Console.WriteLine(s);
>
>--
>
>My name's Paul, and this's between ya'll.
>
>John.
>
>===================================
>This list is hosted by DevelopMentor(r) http://www.develop.com
>Some .NET courses you may be interested in:
>
>NEW! Guerrilla ASP.NET, 17 May 2004, in Los Angeles
>http://www.develop.com/courses/gaspdotnetls
>
>View archives and manage your subscription(s) at
http://discuss.develop.com
===================================
This list is hosted by DevelopMentor� http://www.develop.com
Some .NET courses you may be interested in:
NEW! Guerrilla ASP.NET, 17 May 2004, in Los Angeles
http://www.develop.com/courses/gaspdotnetls
View archives and manage your subscription(s) at http://discuss.develop.com