1 개요[ | ]
- C++ strtolower()
C++
Copy
#include <iostream>
using namespace std;
string strtolower(string str) {
for(auto &c: str) c = tolower(c);
return str;
}
int main() {
cout << strtolower("Hello World!") << endl; // hello world!
}
Loading
C++
Copy
#include <iostream>
#include <algorithm> // transform
using namespace std;
string strtolower(const string str) {
string ret = str;
transform(ret.begin(), ret.end(),ret.begin(), ::tolower);
return ret;
}
int main() {
cout << strtolower("Hello World!") << endl; // hello world!
}
Loading
2 같이 보기[ | ]
편집자 Jmnote Jmnote bot
로그인하시면 댓글을 쓸 수 있습니다.