左对齐,右补空格

public static void main(String[] args) {
		System.out.println("0123456789"+"|");
		System.out.println(String.format("%1$-10s", "ds df")+"|");
	}

猜你喜欢

转载自see-you-again.iteye.com/blog/2237884