I'm printing out a list of things and I formatted the text with spaces. but instead of spaces I just want all dashes.... I cant figure out or find a way to do this and at the same time keep the text formatted correctly.
here is my format code:
System.out.println(String.format("Word:%11s-----------Hash Value:%5s ",arrayString[i],arrayNums[i]));
here is an example output:
Word: DO-----------Hash Value: 2
Word: END-----------Hash Value: 3
Word: ELSE-----------Hash Value: 4
Word: CASE-----------Hash Value: 5
Word: DOWNTO-----------Hash Value: 6
Word: GOTO-----------Hash Value: 7
Word: TO-----------Hash Value: 8
Word: OTHERWISE-----------Hash Value: 9
Word: TYPE-----------Hash Value: 10
Word: WHILE-----------Hash Value: 11
Word: CONST-----------Hash Value: 12
Desired output:
Word:---------DO-----------Hash Value:----2