Advertisement
Guest User

Untitled

a guest
Jun 22nd, 2018
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.25 KB | None | 0 0
  1. string norm(string s) {
  2.     string res;
  3.     for (char &c : s) {
  4.         if (isalnum(c) || c == '_')
  5.             if (!reg && isalpha(c))
  6.                     res += tolower(c);
  7.                 else
  8.                     res += c;
  9.         else
  10.             if (!res.empty() && res.back() != ' ')
  11.                 res += ' ';
  12.     }
  13.     return res;
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement