Remove leading zeros with regex but keep minus-sign?

You can try with: String output = "-00.8899". Replace("^(-? )0*", "$1"); Output: -.8899.

Java being a strongly-typed language, you would probably have an easier time converting that to a float or double, then doing all the business logic, then finally formatting the output. Something like: Double d = Double. ParseDouble(s); double val = d; //mind the auto-boxing/unboxing //business logic //get ready to display to the user DecimalFormat df = new DecimalFormat("#.0000"); String s = df.

Format(d); download.oracle.com/javase/7/docs/api/ja....

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions