텍스트 문자열과 열 너비를 사용하고 각 열을 열 너비로 제한하는 메서드를 구현하려고합니다. 열 너비 20Java에서 println() 문의 문자 수 제한
Triometric creates unique end user monitoring products for high-value Web applications, and offers unrivalled expertise in performance consulting.
는 다음과 같은 출력을 초래할 것 :
이Triometric creates unique end user monitoring products for high-value Web applications, and offers unrivalled expertise in performance consulting.
문자열의 문자를 반복하고 'width'번째 문자 다음에 '\ n'을 추가하십시오. –
음, 그렇게 쉽지 않습니다. @kocko. 단어 중간에 줄 바꿈이 생길 수 있습니다. –
즉, @ user3182511라고하면 'width'가 단어 길이보다 작 으면 어떻게 될까요? 한 줄에 20 번째 문자로 삽입 된 하이픈이 있으면 나머지 줄이 계속됩니까? –