Checking, whether string contains only ascii.
aberba via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Wed Feb 22 14:59:01 PST 2017
On Wednesday, 22 February 2017 at 20:01:57 UTC, Adam D. Ruppe
wrote:
> On Wednesday, 22 February 2017 at 19:26:15 UTC, berni wrote:
>> herefore I'd like to make sure that the string the program
>> read is only made up of ascii characters.
>
> Easiest:
>
> foreach(char ch; postscript)
> if(ch > 127) throw new Exception("non-ascii detected");
:)
More information about the Digitalmars-d-learn
mailing list