2013-01-19から1日間の記事一覧

STLを使って文字列を小文字化

C++

std::transform(str.begin(), str.end(), str.begin(), ::tolower); というのを使うと一行で書けるらしい。 #include <algorithm> #include <iostream> #include <string> int main(){ std::string data = "jAnUaRY"; std::cout << data << std::endl; // 文字列中のすべての大文字を小文</string></iostream></algorithm>…