Advertisement
urksiful

Contains Number Method

Jun 5th, 2016
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.31 KB | None | 0 0
  1. public boolean containsNumbers(String cad){
  2.         if(cad.contains("0") || cad.contains("1")|| cad.contains("2")
  3.             || cad.contains("3")|| cad.contains("4")|| cad.contains("5")
  4.             || cad.contains("6")|| cad.contains("7")|| cad.contains("8")
  5.             || cad.contains("9")){
  6.  
  7.             return true;
  8.         }else{
  9.             return false;
  10.         }
  11.  
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement