ReadOnlySpan<char>.EndsWith using char instead of string? #105929
-
How can I check if a char-based span ends with a single character (in a readable way) without using a string? I.e. instead of: var s = "test".AsSpan();
bool b = s.EndsWith("t".AsSpan()); something like: var s = "test".AsSpan();
bool b = s.EndsWith('t'); |
Beta Was this translation helpful? Give feedback.
Answered by
huoyaoyuan
Aug 5, 2024
Replies: 1 comment
-
#87689 |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
Symbai
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
#87689
Already merged in 9.0