I was wondering if there is a better implementation for converting the following VB6 snippets in Immediate window to Java:
? Format("002-", "")
-2
? Str("002-")
-2
My Java code scans through the string and if it sees a negative sign, converts the string to a negative integer, else positive. I would like to know if Java has a utility function which functions the same way as this.
A link to the Str function here.
Thanks!