Here you can find the source of trimEndDigital(List
private static List<String> trimEndDigital(List<String> strs)
//package com.java2s; //License from project: Apache License import java.util.List; public class Main { private static List<String> trimEndDigital(List<String> strs) { String endStr = strs.get(strs.size() - 1); try {/*from www . jav a 2 s . co m*/ Integer.parseInt(endStr); //has number .remove last strs.remove(strs.size() - 1); } catch (NumberFormatException e) { return strs; } return strs; } }