So I get a random word from a website and use the length()
method to obtain how many letters are in the word. Now I want to display these as dashes (-
). For example, say the word is "dogs". The length method will return 4. Now I want to convert that into ----
. Is there any way in java to say in -
the number representing the length of the word?
Asked
Active
Viewed 876 times
1

helderdarocha
- 23,209
- 4
- 50
- 65

dracula90
- 17
- 5
-
You can loop `length` times and append or print a '-'. – helderdarocha Mar 06 '14 at 17:24
-
you have to parse the html in java and search check this answer http://stackoverflow.com/questions/9664778/parsing-html-in-java?answertab=votes#tab-top – Jorge Mar 06 '14 at 17:25