Slide 11
Slide 11 text
UTF-8 ⽂字列リテラル (proposal)
byte[] array = "hello"; // new byte[] { 0x68, 0x65, 0x6c, 0x6c, 0x6f }
Span span = "dog"; // new byte[] { 0x64, 0x6f, 0x67 }
ReadOnlySpan span = "cat"; // new byte[] { 0x63, 0x61, 0x74 }
// u8 suffix on string literals
string s1 = "hello"u8; // Error
var s2 = "hello"u8; // OK and type is byte[]
Span s3 = "hello"u8; // OK due to an implicit user-defined conversion from byte[]
ReadOnlySpan s3 = "hello"u8; // OK due to an implicit user-defined conversion from byte[]
csharplang/utf8-string-literals.md at main · dotnet/csharplang · GitHub