public static void main(String[] a
rgs) {
// TODO Auto-generated method stub
String word = "Chennai 600042";
for (int i = 0; i<word.length();i++ )
{
if(word.charAt(i)>='0')
if(word.charAt (i)<='9')
System.out.print(word.charAt(i));
}
}
out put 600042
Top comments (0)