Kimossab

SToUpper / Is_Num_Only

Dec 28th, 2014
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.36 KB | None | 0 0
  1.     //converte uma string em maiusculas
  2.     static string SToUpper(string s)
  3.     {
  4.         string result = "";
  5.         for(unsigned int i=0; i<s.length(); i++)
  6.             result+=toupper(s[i]);
  7.         return result;
  8.     }
  9.     //verifica se string é um numero positivo
  10.     static bool Is_Num_Only(String ^s)
  11.     {
  12.         for(int i=0; i<s->Length;i++)
  13.             if(!isdigit(s[i]))
  14.                 return false;
  15.         return true;
  16.     }
Advertisement
Add Comment
Please, Sign In to add comment