Welcome to the Java Programming Forums
The professional, friendly Java community. 21,500 members and growing!
The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.
Members have full access to the forums. Advertisements are removed for registered users.
Look at the split() method.
split() is a String method. It is used in lots of code posted on the forum. Do a search for some examples.
The are many examples given in the API doc for the split() method that use simple Strings.
Look at some of them and see if the String you want to split has anything like what the examples show.
regex stands for regular expression. That's something you'll not want to worry about for a while.
Did you try the simple example you found? What happened?
There are lots of tutorials on how to write regular expressions. Follow the links in the String class's API doc
and ask google.
The API doc shows that the arg to the split method is a String named regex. Read the API doc for a description of the variable: regex in the Parameters: section.do I type "regex" or is that a descriptive placeholder representing the actual delimter I wish to use?
An easy way to see array contents:System.out.println("an ID "+ java.util.Arrays.toString(theArrayName));
javaiscool (March 26th, 2013)