Created
March 14, 2022 17:00
-
-
Save kolosovpetro/b1ba0ae334f2b454dcb3ee17f717cc78 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // See https://aka.ms/new-console-template for more information | |
| using System.Runtime.InteropServices; | |
| const string s = "hello world."; | |
| Span<char> span = MemoryMarshal.CreateSpan(ref MemoryMarshal.GetReference(s.AsSpan()), s.Length); | |
| span[11] = '!'; | |
| Console.WriteLine(s); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment