aspose file tools*
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
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: 19073
    
  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