Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

indent whitespace

 
nate saider
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there anyway to indent output based on the integer value of an variable?
for example...
if

then

will indent "hello" three times over and output
>[/n][/n][/n]Hello
and not
>Hello
thanks.
[ July 29, 2002: Message edited by: nate saider ]
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One strategy you might consider would be use a loop to prefix your output with the appropriate number of space characters. Take a look at http://www.asciitable.com to find which character is the space character (hint: it's number 32).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic