File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes Help Reading and storing characters Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "Help Reading and storing characters" Watch "Help Reading and storing characters" New topic
Author

Help Reading and storing characters

jose santelices
Greenhorn

Joined: Feb 02, 2010
Posts: 4
How can i Read a Word that is declared as String and then divide the word and store each character in a variable

Right now Im writing a program that reads a line like this one: HDSL841216CLDNO895

What I want its to store each character in that line in a different variable, I'm trying to get into array but cannot figure out the codem I had tryied as String Split but also I dont know how to store each character in a different variable, Does any body can help me?

What im trying to do exactly is read that line that is in a TextField and then Print a birthday based on the first 4 numbers in the line(year,month,day). I only need the instructions on how to read and store each character in a different variable as I've been trying all day, its driving me crazy

Regards to everybody


here is a little code i have so far but its like nothing i really got nothing im blind with this xD

Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 8439

Jose,
Welcome to the Ranch.

Check out the String#toCharArray and String#charAt and String#length methods.
Now can you think of any why to use a combination of these to extract the first 4 characters in your string?


[Donate a pint, save a life!] [How to ask questions] [Onff-turn it on!]
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Help Reading and storing characters
 
Similar Threads
BufferedReader contents into Array
testing
Scanning a text file
Still Stacks
reverse the text file and write