In this article, we will see how to use format method of String to add padding to string in Java.
Lets look to our code.
String.Format(".... %s","andromeda");
Lets see it in an example.
In above java formatter example, we said formatter to make our string 8 char acter. The number is padded according to it.