Skip to content

Get first N characters of a string: net11.0, Substring and range methods - #2387

Merged
vladimir-pecanac-main merged 2 commits into
CodeMazeBlog:mainfrom
vladimir-pecanac-main:seo/109757-csharp-fastest-way-to-get-the-first-n-characters-of-a-string
Nov 14, 2026
Merged

vladimir-pecanac-main merged 2 commits into
CodeMazeBlog:mainfrom
vladimir-pecanac-main:seo/109757-csharp-fastest-way-to-get-the-first-n-characters-of-a-string

Conversation

@vladimir-pecanac-main

Copy link
Copy Markdown
Collaborator

Moves the GetFirstNCharactersOfAString sample to net11.0 with BenchmarkDotNet 0.15.8, xunit 2.9.3, xunit.runner.visualstudio 4.0.1, Microsoft.NET.Test.Sdk 18.12.0 and coverlet.collector 10.1.0. Adds the Substring, range operator, range with Math.Min and first character methods with their tests, adds the Substring, range and AsSpan-then-ToString benchmarks, runs the benchmark class in process so it works on net11.0, passes args to BenchmarkSwitcher so --filter and --job work, and fixes six test names in LongerStringTests that said EqualString.

@vladimir-pecanac-main
vladimir-pecanac-main merged commit 796366c into CodeMazeBlog:main Nov 14, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant