How to check if given string contains lowercase letters in C++

1 Answer

0 votes
#include <iostream>
#include <algorithm>

using std::cout;
using std::endl;
using std::string;

int main()
{
	string s = "Java";

	bool result = std::any_of(s.begin(), s.end(), islower);

	if (result)
		cout << "yes" << endl;
	else
		cout << "no" << endl;

	return 0;
}


/*
run:

yes

*/

 



answered Feb 5, 2018 by avibootz

Related questions

...