> How do I go about parsing integers from following form?
>
[quoted text clipped - 4 lines]
>
> TIA!
public void bushSucks(String s, Hashtable h) {
int index = s.indexOf(':');
String letter = "" + s.charAt(index-1);
int number = Integer.parseInt("" + s.charAt(index+1));
h.put(letter, number);
woot(s.substring(s.indexOf(')')) + 1, s.length(), h);
}
eh, somephin like that I guess. Not the best solution, but since I am
assuming you are a student. It would be best for you to find a better way.
:)
PaulR - 28 Apr 2005 11:11 GMT
I'm sure you could do something with regular expressions here.
Something like "\(.*?\)" to get the bracketed groups. Then "\d" to get
the digit groups.
PaulR - 28 Apr 2005 11:12 GMT
I'm sure you could do something with regular expressions here.
Something like "\(.*?\)" to get the bracketed groups. Then "\d" to get
the digit groups.
Betty - 29 Apr 2005 23:24 GMT
> > How do I go about parsing integers from following form?
> >
[quoted text clipped - 12 lines]
> woot(s.substring(s.indexOf(')')) + 1, s.length(), h);
> }
Is the "d9" part a typo? Should it be "d:9"?