Java tutorial
//package com.java2s; public class Main { static int dateParseDay(String date) { int ret = 0; char ch = date.charAt(8); if (ch >= '1' && ch <= '3') ret += 10 * (ch - '0'); ch = date.charAt(9); if (ch >= '1' && ch <= '9') ret += (ch - '0'); return (ret > 0) ? ret : 0; } }