m2skills

anagrams WHITESPACES

Jul 13th, 2017
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.20 KB | None | 0 0
  1.  
  2.     //function to remove white spaces
  3.     string removespace(string str)
  4.     {    
  5.         int m = str.length();
  6.         int i=0;
  7.         while(i<m)
  8.         {
  9.             while(str[i] == 32)
  10.             str.erase(i,1);
  11.             i++;
  12.         }    
  13.     }
Add Comment
Please, Sign In to add comment