Add spaces in a String using Java

If u would like to print String "123" as "1 2 3" then follow this code.


yourString.replace("", " ").trim();
Above code just replacing all empty place with Space & remove starting space with trim           method




No comments:

^ Top