wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes splitting a string into two variable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "splitting a string into two variable" Watch "splitting a string into two variable" New topic
Author

splitting a string into two variable

Selva Kumar Sundram
Greenhorn

Joined: Apr 26, 2008
Posts: 2
i manage to read a textfile with my program which is a string that looks like this: stuck in a hole in the backyard;60173317358
i want to save stuck in a hole in the backyard in variable x and 60173317358 in variable y. can anyone tell me how to do this? thanks in advance
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18545
    
  40

Originally posted by Selva Kumar Sundram:
i manage to read a textfile with my program which is a string that looks like this: stuck in a hole in the backyard;60173317358
i want to save stuck in a hole in the backyard in variable x and 60173317358 in variable y. can anyone tell me how to do this? thanks in advance


Have you taken a look at the split() method -- of the String class?

Henry


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: splitting a string into two variable
 
Similar Threads
Dropped toolbag by astronaut can be seen from Earth
WA #1.....word association
Which part of the world is this place?
splitting string into 2 variable
What is your first language ?