1.11M Members

Read Char From file .txt in java

 
0
 

i have a file.txt like this : 2X^2 + 5X+3=0
i want to save 2 to variable a, 5 to variable b, and 3 to variable c . .
how i can do that . . ?
tanks for your help . .

 
0
 

How do you know if a number is to go to a variable or not?
Your example skips over the second 2 and the 0?

A regular expression might help you extract the numbers from the String you posted.
Also the StreamTokenizer class could work.

 
0
 

thank for your help . .

You
This article has been dead for over six months: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article