package com.codefish.util;
/**
* @author codefish
* @date 2021/8/26
* @apinote
*/
public class StringFormat {
public static void main(String[] args) {
//字符串左对齐
String name = "张三";
String name1 = "刘二麻子";
System.out.print(String.format("%-8s", name1));
System.out.print(String.format("%-8s\n", name1));
System.out.print(String.format("%-8s", name1));
System.out.print(String.format("%-8s\n", name));
}
}