Search
 
SCRIPT & CODE EXAMPLE
 

CPP

check if whole string is uppercase

#include <iostream>
#include <string>
#include <algorithm>

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." << '
';
    } else {
        std::cout << "Is not uppercase." << '
';
    }
}
Comment

PREVIOUS NEXT
Code Example
Cpp :: how to sort a string alphabetically in c++ 
Cpp :: naive pattern matching algorithm 
Cpp :: clear qlayout 
Cpp :: how to find the sum of a vector c++ 
Cpp :: Pyramid pattren program in C++ 
Cpp :: c++ cout format 
Cpp :: c++ print 3d cube 
Cpp :: c++ code for bubble sort 
Cpp :: how to sort in descending order in c++ 
Cpp :: iterate over vector in c++ 
Cpp :: c++ thread incide class 
Cpp :: how to check a number in string 
Cpp :: Reverse Level Order Traversal cpp 
Cpp :: 3d projection onto 2d plane algorithm 
Cpp :: 3d vector c++ resize 
Cpp :: pragma cpp 
Cpp :: cpp mark getter as const 
Cpp :: how to split string into words c++ 
Cpp :: Find the biggest element in the array 
Cpp :: how to turn int into string c++ 
Cpp :: c plus plus 
Cpp :: list in c++ 
Cpp :: c++ split string by space into array 
Cpp :: find a number in vector c++ 
Cpp :: vector in c++ 
Cpp :: grep xargs sed 
Cpp :: prime number c++ 
Cpp :: walk filesystem in c++ 
Cpp :: friend function in c++ 
Cpp :: Pseudocode of Dijkstra’s Algorithm in C++ 
ADD CONTENT
Topic
Content
Source link
Name
8+6 =