Here you can find the source of startsWithChar(String s, char c)
public static boolean startsWithChar(String s, char c)
//package com.java2s; //License from project: Open Source License public class Main { public static boolean startsWithChar(String s, char c) { if (s.length() == 0) { return false; }/*w ww . j av a 2s .c om*/ return s.charAt(0) == c; } /** * Gets a String's length or <code>0</code> if the String is * <code>null</code>. * * @param str * a String or <code>null</code> * @return String length or <code>0</code> if the String is * <code>null</code>. * @since 2.4 */ public static int length(String str) { return str == null ? 0 : str.length(); } }