4
I would like to know how to format a String 08041995 on 08/04/1995 using the Java format() method
PrintStream ps = new PrintStream(arq);
String valor = "250,35";
ps.format("R$ "+"%s", valor);
ps.flush();
I was able to insert a String (R$) at the beginning of the String (value), but insert elements in a String, such as bars... I don’t know.
How to do it? Thanks!
It would be even better if you created a custom formatter by extending the java.text.Format class to encapsulate the logic of this conversion within it and reuse it within your code.
– Giuliana Bezerra