Java tutorial
//package com.java2s; import android.text.TextUtils; public class Main { public static String clearMonthDate(String word) { String result = ""; for (int i = 0; i < word.length(); i++) { if (TextUtils.isDigitsOnly(Character.toString(word.charAt(i)))) { result += Character.toString(word.charAt(i)); } } return result; } }