Last active
August 29, 2015 14:05
-
-
Save 9SQ/9a0b8d5354c2cd5d6e32 to your computer and use it in GitHub Desktop.
カンマ区切りで渡された引数を配列に
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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