Here you can find the source of endsWith(String string, String... endsWithText)
Parameter | Description |
---|---|
string | String |
endsWithText | String ... |
public static boolean endsWith(String string, String... endsWithText)
//package com.java2s; /*/*from w ww . java2 s. co m*/ * Copyright 2015 Pegasus Solutions * @author Rafael Peres dos Santos * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by * applicable law or agreed to in writing, software distributed under the * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS * OF ANY KIND, either express or implied. See the License for the specific * language governing permissions and limitations under the License. * * ================================================================================ * * Direitos autorais 2015 Pegasus Solutions * @author Rafael Peres dos Santos * * Licenciado sob a Licen?a Apache, Vers?o 2.0 ("LICEN?A"); voc? n?o pode usar * esse arquivo exceto em conformidade com a esta LICEN?A. Voc? pode obter uma * c?pia desta LICEN?A em http://www.apache.org/licenses/LICENSE-2.0 A menos que * haja exig?ncia legal ou acordo por escrito, a distribui??o de software sob * esta LICEN?A se dar? ?COMO EST????, SEM GARANTIAS OU CONDI??ES DE QUALQUER * TIPO, sejam expressas ou t?citas. Veja a LICEN?A para a reda??o espec?fica a * reger permiss?es e limita??es sob esta LICEN?A. * */ public class Main { /** * return true if the string endsWith in any endsWithText * * @param string {@link String} * @param endsWithText {@link String}... * @return boolean */ public static boolean endsWith(String string, String... endsWithText) { if (endsWithText != null) { for (String endWithText : endsWithText) { if (string.endsWith(endWithText)) { return true; } } } return false; } }