String hello = "Hello";
String.format("%s %s %s %s %s %s", hello, hello, hello, hello, hello, hello);
hello hello hello hello hello hello
형식 메서드 호출시 hello 변수를 여러 번 반복해야합니까? 아니면 %s
토큰 전체에 적용 할 인수를 한 번 지정할 수 있도록하는 약식 버전이 있습니까? the docs에서String.format에서 동일한 매개 변수를 여러 번 사용하면 어떨까요?
https://docs.oracle.com/javase/8/docs/api/java/util/Formatter.html#dpos : 형식이 올바른 것으로 나타나면, 공간은 텍스트 편집기에서 제거 할 수 있습니다 – Vadzim