Here you can find the source of left(String source, String searchFor)
public static String left(String source, String searchFor)
//package com.java2s; //License from project: Open Source License public class Main { public static String left(String source, String searchFor) { String resultado = source; int index = source.indexOf(searchFor); if (index > 0) resultado = source.substring(0, index); return resultado; }//from w w w.j av a 2 s . c o m }