Java String Left left(String source, String searchFor)

Here you can find the source of left(String source, String searchFor)

Description

left

License

Open Source License

Declaration

public static String left(String source, String searchFor) 

Method Source Code

//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
}

Related

  1. left(String s, int nCaratteri)
  2. left(String s, int size)
  3. left(String s, int width)
  4. left(String source, int length)
  5. left(String source, String searchFor)
  6. left(String str, int count)
  7. left(String str, int len)
  8. left(String str, int len)
  9. left(String str, int len)