std.uni, std.ascii, std.encoding, std.utf ugh!
learner
learner at nomail.com
Tue May 5 18:41:50 UTC 2020
Good morning,
Trying to do this:
```
bool foo(string s) nothrow { return s.all!isDigit; }
```
I realised that the conversion from char to dchar could throw.
I need to validate and operate over ascii strings and utf8
strings, possibly in separate functions, what's the best way to
transition between:
```
immutable(ubyte)[] -> validate utf8 -> string -> nothrow usage ->
isDigit etc
immutable(ubyte)[] -> validate ascii -> AsciiString? -> nothrow
usage -> isDigit etc
string -> validate ascii -> AsciiString? -> nothrow
usage -> isDigit etc
```
Thank you
More information about the Digitalmars-d-learn
mailing list