Use split()
method
Eg:
String s = "I want to walk my dog";
String[] arr = s.split(" ");
for ( String ss : arr) {
System.out.println(ss);
}
More Related Contents:
- which programming language I should use between java and ruby for creating Android and iPhone app [closed]
- pulling text from file with Java [closed]
- What does ‘synchronized’ mean?
- Can’t add value to the Java collection with wildcard generic type
- get width and height of JPanel outside of the class
- Java: notify() vs. notifyAll() all over again
- Initial size for the ArrayList
- How to fix role in Spring Security?
- ArithmeticException: “Non-terminating decimal expansion; no exact representable decimal result”
- Sorted collection in Java
- Read large files in Java
- How to calculate the number of rows (and columns in each row) a text takes in a JTextArea?
- Class JavaLaunchHelper is implemented in both … libinstrument.dylib. One of the two will be used. Which one is undefined
- Environment variables in Eclipse
- How to set classpath when I use javax.tools.JavaCompiler compile the source?
- Is there a way in Java to determine if a path is valid without attempting to create a file?
- kill -3 to get java thread dump
- Why is method overloading and overriding needed in java? [duplicate]
- How to use this boolean in an if statement?
- getting java.lang.reflect.InvocationTargetException while adding a button to layout
- Could not load extension from scoped_dir6312_32763/internal.Loading of unpacked extensions is disabled by the administrator with ChromeDriver Selenium
- Where can I find a list of available JSR-223 scripting languages? [closed]
- Adjust brightness and contrast of BufferedImage in Java
- What’s a good library for parsing mathematical expressions in java? [closed]
- Format a date using the new date time API
- How can I change the tickLabel on a NumberAxis in JFreeChart?
- Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment]
- How can I write a WAV file from byte array in java? [closed]
- Create Java DateTime Instant from microseconds
- The purpose of interfaces continued