Here you can find the source of endsWith(String fullString, String subString)
Parameter | Description |
---|---|
fullString | a parameter |
subString | a parameter |
public static boolean endsWith(String fullString, String subString)
//package com.java2s; /*//from ww w . j a v a 2 s . co m * Copyright 2012-2014 Netherlands eScience Center. * * 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 the following location: * * 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. * * For the full license, see: LICENSE.txt (located in the root folder of this distribution). * --- */ public class Main { /** * Null Pointer proof String.endsWith() method. First argument is complete * string and second argument is the substring which the first argument * should end with. If either strings is NULL, false is returned. * * @param fullString * @param subString * @return true if no argument is NULL and * fullString.endsWith(subString)==true */ public static boolean endsWith(String fullString, String subString) { if (fullString == null) return false; if (subString == null) return false; return fullString.endsWith(subString); } }