Docs // ex: HomeController.cs using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Logging; using System; using System.Diagnostics; using System.Linq; using System.Threading.Tasks; using static System.Console; using Env = System.Environment; namespace WebApplication1.Controllers { ... } 通常の using ディレクティブ (ファイル スコープ) // ex: globalusings.cs global using Microsoft.AspNetCore.Mvc; global using Microsoft.Extensions.Logging; global using System; global using System.Diagnostics; global using System.Linq; global using System.Threading.Tasks; global using static System.Console; global using Env = System.Environment; global using ディレクティブ (プロジェクト スコープ) // ex: HomeController.cs namespace WebApplication1.Controllers { ... }
{ 0x68, 0x65, 0x6c, 0x6c, 0x6f } Span<byte> span = "dog"; // new byte[] { 0x64, 0x6f, 0x67 } ReadOnlySpan<byte> 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<byte> s3 = "hello"u8; // OK due to an implicit user-defined conversion from byte[] ReadOnlySpan<byte> s3 = "hello"u8; // OK due to an implicit user-defined conversion from byte[] csharplang/utf8-string-literals.md at main · dotnet/csharplang · GitHub