Android examples for java.lang:String Split
Find first element in a string Split by char
import java.io.UnsupportedEncodingException; import java.util.*; public class Main{ /**// www . j a va 2 s.c o m * Find first element, Split by char * * @param src string to be split * @param ch which is used to split <code>src</code> * @return string after split with first char */ public static String splitFirst(String src, char ch) { return src.substring(0, src.indexOf(ch)); } }