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!)