Here you can find the source of startsWithSpace(String s)
public static boolean startsWithSpace(String s)
//package com.java2s; //License from project: Open Source License public class Main { public static boolean startsWithSpace(String s) { if (s != null && s.length() > 0) { char first = s.charAt(0); if (first == ' ') return true; }//from w w w . jav a 2s.co m return false; } }