I have a situation in which I need to display a string with some spaces in the UI. This is for better readability.
For example if my data is “1234567890”, I want to display it as “123 456 7890”. I was wondering if this can be done using Java’s String format methods?
No, you’d have to implement your own code. See here for the String API.