1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
|
// isupper example (C++)
#include <iostream> // std::cout
#include <string> // std::string
#include <locale> // std::locale, std::isupper, std::tolower
int main ()
{
std::locale loc;
std::string str="Test String.\n";
char c;
for (std::string::size_type i=0; i<str.length(); ++i)
{
c=str[i];
if (std::isupper(c,loc)) c=std::tolower(c,loc);
std::cout << c;
}
return 0;
}
|