On Wednesday, February 19, 2025 7:48:48 PM MST Jonathan M Davis via Digitalmars-d-learn wrote: > So you should probably either just make your code operate on ranges of > dchar, or you'll need to wrap your ranges using byChar or byCodeUnit in > order to get ranges of char. All range-based functions will treat your > strings as ranges of dchar. So, if really need to have strings and be > treating them as ranges of char without wrapping them and without > potentially creating new strings from wrapped ranges, then you can't use any > range-based functions to do what you're doing.
To add to this, another option is to use std.string.representation to cast a string to immutable(ubyte)[] - or an array of whatever the corresponding integer type is if you're not dealing with immutable(char)[] - and operate on that instead. But you can't use string as-is and have a range of char. - Jonathan M Davis