Long checkDataType(String s){
char c[]=s.toCharArray();
boolean isnum=true;
for(int i=0;i
if(!Character.isDigit(c[i])){
isnum=false;
break;
}
}
if(isnum)
return (Long.parseLong(s));
else
return null;
}
char c[]=s.toCharArray();
boolean isnum=true;
for(int i=0;i
if(!Character.isDigit(c[i])){
isnum=false;
break;
}
}
if(isnum)
return (Long.parseLong(s));
else
return null;
}
No comments:
Post a Comment