Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Beginning Java
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
Beginning Java
how to depart String by "space"
marshal ma
Greenhorn
Posts: 23
posted 18 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
I have a
String
like "it is good", I know the String is made of three words(two space between three words), I want to turn it to three String, like this:
String data1 = it;
String data2 = is;
String data3 = good;
How to do that easily?
Thanks,
Ernest Friedman-Hill
author and iconoclast
Posts: 24207
46
I like...
posted 18 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
The String.split() method is a very easy way to do exactly what you want.
[Jess in Action]
[AskingGoodQuestions]
marshal ma
Greenhorn
Posts: 23
posted 18 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi Ernest Friedman-Hill
Got it, I didn't know there is such a good method.
Thanks a lot,
Julien Grenier
Ranch Hand
Posts: 41
posted 18 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Lesson number one : Know your API
Think of how stupid the average person is. And how half of them are stupider than that. But who reads this tiny ad?
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
String confusion
Regex help
String - remove more than one space between words
how can i separate string?
JTextArea line break
More...