This week's book giveaway is in the Security forum.
We're giving away four copies of Securing DevOps and have Julien Vehent on-line!
See this thread for details.
Win a copy of Securing DevOps this week in the Security forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to display all of the ascii characters  RSS feed

 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to write a little code to display all of the ascii characters, but it doesn't seem to like to concatenate the backslash with an int. Any ideas on how to get this to work?

Thanks!!

 
Sheriff
Posts: 57882
178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The escape characters for \123 are in octal. Try 0400 instead of 400. Some of them are control characters, which don't print. Two are line end characters, so you only see a line break.
And it's "\\" not "\".
Make sure to print \007 several times
 
Jeff Ciaccio
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When I make it "\\", I only get the following:
1: \1
2: \2
3: \3
4: \4
5: \5
6: \6
7: \7

But I want to see the characters for each. I don't want to have to put in "\1" "\2" etc so I am trying to get a loop to do this for me.
 
Sheriff
Posts: 21256
87
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How about simply casting it to char?
Also, ASCII ends at 127. Everything beyond that is no longer ASCII.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!