Skip to content

Instantly share code, notes, and snippets.

@9SQ 9SQ/Csv2array.java
Last active Aug 29, 2015

Embed
What would you like to do?
カンマ区切りで渡された引数を配列に
public class Csv2array {
public static void main(String[] args) {
if (args.length < 1) {
System.out.println("Usage: java -jar Csv2array.jar [username(comma separated username)]");
System.exit(-1);
}
String[] split = args[0].split(",");
String[] usernameArray = new String[split.length];
for (int i = 0; i < usernameArray.length; i++) {
usernameArray[i] = split[i];
}
/* ここでusernameArrayを使った処理 */
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.