• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to avoid special charcters from a file  RSS feed

 
Srinivas Vanjari
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,good afternoon to all,i have a problem with programming,i can't getting this solution from 2 weeks...


My question is how to avoid a special charaters like # ,@,$ from a string....


please post the answer.........................
 
Praveen Kumar M K
Ranch Hand
Posts: 256
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Srinivas,

Need a little more information. Are these characters coming from a text file? Am sure you would've stored the incoming data into some sort of buffer, so you should be able to easily parse that and remove whatever you want. If you could post a code sample, that would be great!
 
John Jai
Rancher
Posts: 1776
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Srinivas Vanjari wrote:please post the answer.........................


Please read NotACodeMill and TellTheDetails
 
Campbell Ritchie
Marshal
Posts: 56546
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch

Why are you calling those characters special? What is special about them? What sort of character do you call ordinary? When you have sorted out those questions, you will probably find it easy to achieve what you want.
 
Tim Moores
Saloon Keeper
Posts: 4032
94
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also, what does it mean to "avoid" them?
 
Srinivas Vanjari
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Barney Balboa wrote:Srinivas,

Need a little more information. Are these characters coming from a text file? Am sure you would've stored the incoming data into some sort of buffer, so you should be able to easily parse that and remove whatever you want. If you could post a code sample, that would be great!


thanks for the reply....actually i want to read these characters from a file.while printing this characters am getting ascii values...so is there any better solution...



file.txt
---------------------
ag12h3@t$45iy....
 
Campbell Ritchie
Marshal
Posts: 56546
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That last post doesn’t answer any of our questions from earlier. In fact, it suggests you have not considered the points we raised past week.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!