Here you can find the source of startWith(String string1, String string2)
Parameter | Description |
---|---|
string1 | String to test |
string2 | String to be contained |
public static Boolean startWith(String string1, String string2)
//package com.java2s; /*//from ww w . ja va 2 s . c om * Copyright ? WebServices pour l'?ducation, 2014 * * This file is part of ENT Core. ENT Core is a versatile ENT engine based on the JVM. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation (version 3 of the License). * * For the sake of explanation, any module that communicate over native * Web protocols, such as HTTP, with ENT Core is outside the scope of this * license and could be license under its own terms. This is merely considered * normal use of ENT Core, and does not fall under the heading of "covered work". * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */ public class Main { /** * Indicates if the string 1 starts with string2. * * @param string1 String to test * @param string2 String to be contained * * @return true, If the string1 starts with string2 */ public static Boolean startWith(String string1, String string2) { return (string1 != null) ? string1.startsWith(string2) : false; } }