Advertisement
Guest User

Untitled

a guest
Dec 11th, 2019
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. #include <string>
  2. std::string to_camel_case(std::string text) {
  3. for(int i = 0; i < text.length(); ++i)
  4. {
  5. if(text[i] == '-' || text[i] == '_')
  6. {
  7. text.erase(i,1);
  8. text[i] = std::toupper(text[i]);
  9. }
  10. }
  11. return text;
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement