SHARE
TWEET

Untitled

a guest Dec 11th, 2019 83 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top