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

public static String genSharePath(String path) {
    String module = path.split("/")[0];
    return String.format("/md-%s/dist/%s", module, path);
}

From source file:Main.java

private static String[] m4414e(String str) {
    return str != null ? str.split("\\s") : new String[0];
}

From source file:Main.java

public static String getNewsFeedsTime(String filename) {
    filename = filename.split("\\.")[0];
    String[] s = filename.split("-");
    return s[0] + "-" + s[1] + "-" + s[2];
}

From source file:Main.java

public static String getVideoCurrPlayTime(String time) {
    String[] timeArr = time.split("/");
    return timeArr[0].trim();
}

From source file:Main.java

public static String convertUrlToFileName(String url) {
    String[] strs = url.split("/");
    return strs[strs.length - 1];
    //return strs[strs.length - 1] + WHOLESALE_CONV;
}

From source file:Main.java

public static String getVideoTotalTime(String time) {
    String[] timeArr = time.split("/");
    return timeArr[1].trim();
}

From source file:Main.java

/**
 * Splits a comma delimited String sequence into a String[]
 * @param delimited String to split/*from  www  .j a v a  2  s  .  c  om*/
 * @return the split String[]
 */
public static String[] splitDelimitedString(String delimited) {
    return delimited.split(Pattern.quote(", "));
}

From source file:Main.java

public static int ip2int(String ip) {
    String[] items = ip.split("\\.");
    Integer intIP = Integer.valueOf(items[3]) << 24 | Integer.valueOf(items[2]) << 16
            | Integer.valueOf(items[1]) << 8 | Integer.valueOf(items[0]);
    return intIP;
}

From source file:Main.java

public static String getFileName(String url) {

    String[] split = url.split("/");
    return split[split.length - 1];
}

From source file:Main.java

public static String[] getImgArr(String imgUrl) {
    String img[] = imgUrl.split(splitString);
    return img;
}