this post was submitted on 19 Mar 2024
-9 points (20.0% liked)

C Sharp

1526 readers
5 users here now

A community about the C# programming language

Getting started

Useful resources

IDEs and code editors

Tools

Rules

Related communities

founded 1 year ago
MODERATORS
top 2 comments
sorted by: hot top controversial new old
[โ€“] [email protected] 8 points 7 months ago (1 children)

This is potentially dangerous, as it encourages dealing with text as an array of chars. But graphemes in Unicode, which represent a single symbol in a writing system (such as "H", "ๅฟƒ", or "๐Ÿ’š"), can take up multiple chars in a string. The linked approaches only work if you can guarantee that your string only contains ASCII. See also: The Absolute Minimum Every Software Developer Must Know About Unicode in 2023 (Still No Excuses!)

[โ€“] [email protected] 1 points 7 months ago

Yes, good point - I'd forgotten about Unicode in this context.