📜  检查整个字符串是否为大写 - C++ 代码示例

📅  最后修改于: 2022-03-11 14:44:52.843000             🧑  作者: Mango

代码示例1
#include 
#include 
#include 

int main() {
    std::string s = "HELLo";
    if (std::all_of(s.begin(), s.end(), [](unsigned char c){ return std::isupper(c); })) {
        std::cout << "Is uppercase." << '\n';
    } else {
        std::cout << "Is not uppercase." << '\n';
    }
}