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[] getAllData(String retro) {
    return retro.split(END);
}

From source file:Main.java

public static String getRealFontName(String fontName) {
    return fontName.split("-")[0];
}

From source file:Main.java

public static String getUserNameFromEmailAddress(String userEmail) {
    return userEmail.split("@")[0];
}

From source file:Main.java

/**
 * Splits a string into an array of strings by commas
 * @param str//from  ww w. j ava2s  .  co  m
 * @return
 */
public static String[] toStringList(String str) {
    return str.split(",");
}

From source file:Main.java

public static String getSerializedToken(String authHeader) {
    return authHeader.split(" ")[1];
}

From source file:Main.java

public static String getResouceNameByJID(String jid) {
    String str = jid.split("/")[1];
    return str;
}

From source file:Main.java

public static int getValueByName(String ss) {
    String s[] = ss.split(",");
    return Integer.parseInt(s[0].substring(3, s[0].length()));
}

From source file:Main.java

public static long convertMSFromHM(String hm) {
    String str[] = hm.split(":");
    return (Integer.valueOf(str[0]) * 60 + Integer.valueOf(str[1])) * 60 * 1000;
}

From source file:Main.java

private static int hourOfTime(String time) {
    String hour = time.split(":")[0];
    return Integer.parseInt(hour);
}

From source file:Main.java

public static String getFileName(String url) {
    String[] s = url.split("/");
    String name = s[s.length - 1];
    return name;//  ww w.jav a  2s .c  o  m
}