(Moved to a more general forum, since the answer has nothing to do with servlets.)
What do you mean by "convert" - what data type and format does the input have, and what data type and format should the output have? Integer?
String? Something else? Can you give an example of input and desired output?