I'm wondering if there is a String formatter in java similar to the java DecimalFormat("0.#")
I have the following set of numbers that needs to be masked with dashes, "00-0000-00", I was hoping there would be a formatter that would enable me to do this in a similar way you handle DecimalFormat("00-0000-00"). If such a method doesn't exist, could someone please provide an example of an alternate solution.
I need to strip the dashes when saving to the database and add them back in when retrieving them from the database.
Thanks
%the number and plug in the formatter string. As for revert it back,replaceAll("-", "")andparseIntare the solution.