> hi
> ive got a key in the form of
> ABC123-DEF456a
>
> with the ABC and DEF values remaining constant.
> the a being any lower case letter..
>
> i wanna get an int value for this key.... how do i do
> it?
>
> thanks!
Do they need to be unique? What will you use the key for? You can use the hash code if it doesn't need to be unique.
Kaj
> ive got a key in the form of ABC123-DEF456a
>
> with the ABC and DEF values remaining constant.
> the a being any lower case letter..
>
> i wanna get an int value for this key.... how do i do it?
Should the integer value be equal to 123456? You should describe
your requirements a bit more clearly.
kind regards,
Jos
> its for a hash table.
> i want to seperate the numbers (123,456) from the
> letters (ABC,DEF)and add them together.
>
> would i be able to use sub strings for this?
> somet like
>
> String RefNo = s.subString(3,5);
So you don't want to get an integer. You want to get a string with only digits? You can use replaceAll in that case.
Kaj