Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <string>
- std::string to_camel_case(std::string text) {
- std::string output;
- for(int iter = 0; iter < text.size(); ++iter)
- {
- if(text.at(iter) == '-' || text.at(iter) == '_')
- {
- text.at(iter) = toupper(text.at(++iter));
- }
- output += text.at(iter);
- }
- return output;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement