Here you can find the source of endsWithOne(final String src, final String[] dest)
public static int endsWithOne(final String src, final String[] dest)
//package com.java2s; //License from project: Open Source License public class Main { public static int endsWithOne(final String src, final String[] dest) { for (int i = 0; i < dest.length; ++i) { final String m = dest[i]; if (m != null) { if (src.endsWith(m)) { return i; }//from ww w. ja v a 2s. c o m } } return -1; } }