List of usage examples for java.lang String split
public String[] split(String regex)
From source file:Main.java
public static String changeNum(String str, int flag) { String strs[] = str.split(" "); String text = Integer.parseInt(strs[1]) + (flag == 1 ? 1 : -1) + ""; return strs[0] + " " + text; }
From source file:Main.java
public static String[] splitStringWith(String str, String with) { String[] mStr = str.split(with); return mStr; }
From source file:Main.java
public static String[] weightsSplit(String value) { return value.split(","); }
From source file:Main.java
public static boolean isValidEmail(String email) { String tokens[] = email.split("@"); if (tokens.length != 2 || tokens[0].length() == 0 || tokens[1].length() == 0) return false; tokens = tokens[1].split("\\."); if (tokens.length != 2 || tokens[0].length() == 0 || tokens[1].length() == 0) return false; return true;//from w ww. j a v a2 s . c o m }
From source file:Main.java
public static int[] fromSpacedIntString(String string) { String[] strings = string.split("\\t"); int result[] = new int[strings.length]; for (int i = 0; i < result.length; i++) { result[i] = Integer.parseInt(strings[i]); }//from www . j a v a2 s.c o m return result; }
From source file:Main.java
private static String fullFormat(String string) { String[] split = string.split(DELIM_TIME); return minCheck(Integer.valueOf(split[0])) + DELIM_TIME + minCheck(Integer.valueOf(split[1])); }
From source file:Main.java
/** Splitting fully qualified Kerberos name into parts */ public static String[] splitKerberosName(String fullName) { return fullName.split("[/@]"); }
From source file:Main.java
public static String getName(String tagStr) { String[] array = tagStr.split(reg); if (array != null && array.length > 0) { return array[0]; } else {//from w ww. ja v a2 s. c o m return ""; } }
From source file:Main.java
public static String[] parseMockData(String str) { return str.split("[-][.][-][ ]"); }
From source file:Main.java
public static boolean checkValidity(String filePath) { String[] array = filePath.split("."); if (array[array.length - 1].equals("xml")) { return true; } else {//from w ww . j a va 2s.c o m return false; } }