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

C Sharp

1531 readers
1 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 8 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!)

[โ€“] SmartmanApps 1 points 8 months ago

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