Given a character (u8
) in zig, how can I make sure it is in ASCII uppercase?
Does the standard library provide helper functions for this?
Given a character (u8
) in zig, how can I make sure it is in ASCII uppercase?
Does the standard library provide helper functions for this?
Copyright © 2021 Jogjafile Inc.
Use
std.ascii.toUpper(c)
In general, the standard library provides the following functions:
std.ascii.isUpper
std.ascii.toUpper
std.ascii.upperString
And the corresponding functions for lowercase letters:
std.ascii.isLower
std.ascii.toLower
std.ascii.lowerString
Here is some example usage: