String strhours = String.valueOf(123456); String strh = strhours.substring(strhours.length() -2,strhours.length()); //截取 String strm = strhours.substring(0,strhours.length()-2); //截掉 strh内容为 56 strm内容为 1234