islower
function template
<locale>
template <class charT>
bool islower ( charT c, const locale& loc );
Check if character is a lowercase letter using locale
Checks whether c is a lowercase letter using ctype facet of locale loc, returning the same as a call to:
|
use_facet < ctype<charT> > (loc).is (ctype_base::lower, c)
|
This function replicates the functionality of its C-library equivalent islower. See islower for more info.
Parameters
- c
- Character to be checked.
- loc
- Locale to be used. Shall have facet ctype present.
Template parameter charT is the character type.
Return Value
true if indeed c is a lowercase letter, false otherwise.
Example
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
|
// islower example (C++)
#include <iostream>
#include <string>
#include <locale>
using namespace std;
int main ()
{
locale loc;
string str="Test String.\n";
char c;
for (size_t i=0; i<str.length(); ++i)
{
c=str[i];
if (islower(c,loc)) c=toupper(c,loc);
cout << c;
}
return 0;
}
|
Output:
See also
ctype | Character type facet (class template) |
isupper | Check if character is an uppercase letter using locale (function template) |
isalpha | Check if character is alphabetic using locale (function template) |
toupper | Convert lowercase letter to uppercase using locale (function template) |
tolower | Convert uppercase letter to lowercase using locale (function template) |
|