string str = "hello"; ReadOnlySpanIn this example, we create a span that starts at index 2 of the string and has a length of 3. We can then access individual characters of the span using the indexer. The System String AsSpan method is included in the System.Memory package library.span = str.AsSpan(2, 3); char firstChar = span[0]; // 'l'