Formatter: format('%.15s', String str) (Display at most 15 characters in a string)
/*
Formatting with
*/ import java.util.Formatter;
public class MainClass { public static void main(String args[]) {
Formatter fmt = new Formatter();
// Display at most 15 characters in a string.
fmt = new Formatter();
fmt.format("%.15s", "Formatting with Java is now easy.");
System.out.println(fmt);
}
}