Skip to content

Check if a string contains only letters: .NET 11, \z anchor, Rune check - #2438

Merged
vladimir-pecanac-main merged 2 commits into
CodeMazeBlog:mainfrom
vladimir-pecanac-main:seo/109396-csharp-check-if-a-string-contains-only-letters
Nov 30, 2026
Merged

vladimir-pecanac-main merged 2 commits into
CodeMazeBlog:mainfrom
vladimir-pecanac-main:seo/109396-csharp-check-if-a-string-contains-only-letters

Conversation

@vladimir-pecanac-main

Copy link
Copy Markdown
Collaborator

Moves the CheckIfAStringContainsOnlyLetters sample to net11.0 with current xunit, runner, test SDK and coverlet packages, ends both Regex patterns in \z so a trailing newline no longer passes, renames IsOnlyAciiLetters to IsOnlyAsciiLetters, adds IsOnlyLettersByRune for letters outside the BMP, makes Program.cs print how each check handles five tricky inputs, fixes two tests that called the wrong method, and adds tests for empty strings, a trailing newline, a combining accent and a letter outside the BMP (31 tests).

…Regex with \z, add Rune check and edge-case output

Both projects target net11.0 with current test packages. The Regex patterns end in \z so a trailing newline no longer passes, IsOnlyAciiLetters is renamed IsOnlyAsciiLetters, LinqStringChecker gains IsOnlyLettersByRune, Program.cs prints the edge cases, two tests now call the ASCII methods they name, and new tests cover empty strings, a trailing newline, a combining accent and a letter outside the BMP.
@vladimir-pecanac-main
vladimir-pecanac-main merged commit 78d8edb into CodeMazeBlog:main Nov 30, 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