Created
November 1, 2011 20:38
-
-
Save lolsborn/1331827 to your computer and use it in GitHub Desktop.
String split
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
airship1-2:tmp steven$ cat split.java | |
class Split { | |
public static void main(String [] args) { | |
String foo = "1::3"; | |
String[] parts = foo.split("::"); | |
for(int i =0; i < parts.length; i++) { | |
System.out.println(parts[i]); | |
} | |
} | |
}airship1-2:tmp steven$ javac split.java | |
airship1-2:tmp steven$ java Split | |
1 | |
3 | |
airship1-2:tmp steven$ java -version | |
java version "1.6.0_26" | |
Java(TM) SE Runtime Environment (build 1.6.0_26-b03-384-10M3425) | |
Java HotSpot(TM) 64-Bit Server VM (build 20.1-b02-384, mixed mode) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment