Yes, but you need to manipulate the string yourself. You will need to use a StringTokenizer to break the String up, and the Integer.parseInt method to work out the numbers (assuming floats and doubles are invalid). Have a go and see what you come up with, post back with your code if you need more help.
I suggest avoid using StringTokenizer class its a legacy class, to quote the javadocs of version 1.4.2:-
StringTokenizer is a legacy class that is retained for compatibility reasons although its use is discouraged in new code. It is recommended that anyone seeking this functionality use the split method of String or the java.util.regex package instead.
I would suggest using regular expressions similar. Of course in the end you will definitely have to use Integer.parseInt() (or Float.parseFloat() or ..) to convert the numbers from the string to their appropriate types. This is the best resource for learning how to use regular expressions in Java.
may i suggest that you look at the first thread i started after my joining Daniweb? it has a solution to the problem that i got from a book (the art of java, search it on amazon), but i do suggest that you don't look at it until you try something yourself... so, i'll leave it up to you to find, i do have some advice
Think recursively (especially if you want the user to be able to use parenthesis),
use simple cases to work out how it should operate,
Hey, so I wanna ask how I need to create a method who will remove word if in that word is 2 same chars. Example: "Potato" in this word there is a 2 "o" chars so this word will need to be removed. "Forum" in this word there is no ...
Hi. I have a form with list box : lst_product, datagridview : grd_order and button: btn_addline. lst_product has a list of product ids selected from database (MS Acess 2013) , grd_order is by default empty except for 2 headers and btn_addline adds rows to grd_order.
Hi, as I was told that my code doesn’t scale well at all, I thought perhaps I’d try to get a better understanding of interfaces/abstract classes and classes and the relationship between them.
I don’t want at this stage work on a big separate project as I've already got plenty ...