• Post Reply Bookmark Topic Watch Topic
  • New Topic

illegal characters  RSS feed

 
Sasha Hernandez
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Suppose you had a program that was reading in some tokens and you had to test for any illegal characters. How would you do it?
 
bhabani sahu
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
depends on how you define your illegal chars . After you capture the tokens based on your delimiters you'll like to check if your illegal chr exists in the token. You can use String functions if your illegal char is ascii data.
hth.
 
Tom Wolve
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
the String method 'indexOf(..)' is very helpful.
if it returns -1, the character is not in the string.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!