Example usage for java.lang String split

List of usage examples for java.lang String split

Introduction

In this page you can find the example usage for java.lang String split.

Prototype

public String[] split(String regex) 

Source Link

Document

Splits this string around matches of the given regular expression.

Usage

From source file:Main.java

private static String[] convertStringToArray(String str) {
    String[] arr = str.split(",");
    return arr;/*www  . j  a v a  2 s.  c om*/
}

From source file:Main.java

public static int getIntTime(String time) {
    String[] Hm = time.split(":");
    return Integer.parseInt(Hm[0]) * 60 + Integer.parseInt(Hm[1]);
}

From source file:Main.java

public static int recipeIDFromString(String id) {
    String[] split = id.split("-");
    return Integer.parseInt(split[split.length - 1]);
}

From source file:Main.java

/**
 * It gets the host of a URL//  w  w w  .ja  va 2  s.  c  om
 * @param fullPath main string to be parsed
 * @return the host of a URL
 */
public static String host(String fullPath) {
    return fullPath.split("/")[2];
}

From source file:Main.java

public static String[] convertStringToArray(String str) {
    String[] arr = str.split(strSeparator);
    return arr;
}

From source file:Main.java

private static int minuteOfTime(String time) {
    String minute = time.split(":")[1];
    return Integer.parseInt(minute);
}

From source file:Main.java

public static String[] splitString(String str, String by) {
    return str.split(by);
}

From source file:Main.java

public static String[] splitString(String str) {
    String[] mStr = str.split(",");
    return mStr;
}

From source file:Main.java

public static String getJabberID(String from) {
    String[] res = from.split("/");
    return res[0].toLowerCase();
}

From source file:Main.java

/**
 * Kusini Unguja, TZ -> Kusini Unguja (no underscore, like above)
 * @param address/*w w  w .  j a  v a2  s .  c om*/
 * @return
 */
public static String stripCountryFromAddress(String address) {

    return address.split(",")[0];
}