• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to find a special character in a string?  RSS feed

 
Ravi Shankarappa
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I need to find if a line contains "CODE" . The two " are also part of the search. How do I do this using StringTokenizer? Or is there a better way?

-Ravi
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The String.indexOf method comes to mind. Double quotes can be used in a string by prefixing them with a backslash.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!