removing double quotes using strpbrk()

Please support our C advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved

Join Date: Sep 2006
Posts: 38
Reputation: hariza is an unknown quantity at this point 
Solved Threads: 0
hariza hariza is offline Offline
Light Poster

removing double quotes using strpbrk()

 
0
  #1
Oct 9th, 2006
Hi Guys,

I'm trying to remove all the special characters within a file using the code below but I need to remove also the doble quotes " but what should I use to enclose the characters. I've been looking but can't find. Thanks.

while (sep != 0)
{
sep = strpbrk(line, "\<=->/'");
if (sep != 0)
*sep = ' ';
}
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,498
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1478
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Still Learning

Re: removing double quotes using strpbrk()

 
0
  #2
Oct 9th, 2006
use the escape sequence character. and to get the '\' you need two of them
  1. sep = strpbrk(line, "\\<=->/'\"");
Last edited by Ancient Dragon; Oct 9th, 2006 at 11:14 pm.
Reply With Quote Quick reply to this message  
Join Date: Sep 2006
Posts: 38
Reputation: hariza is an unknown quantity at this point 
Solved Threads: 0
hariza hariza is offline Offline
Light Poster

Re: removing double quotes using strpbrk()

 
0
  #3
Oct 9th, 2006
hi There,

I tried but I'm getting:
unknown escape sequence '\<'
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,498
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1478
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Still Learning

Re: removing double quotes using strpbrk()

 
0
  #4
Oct 9th, 2006
yes, I knew that would happen. Please look at my post very carefully because I showed you the correction -- two '\' characters.
Reply With Quote Quick reply to this message  
Join Date: Sep 2006
Posts: 38
Reputation: hariza is an unknown quantity at this point 
Solved Threads: 0
hariza hariza is offline Offline
Light Poster

Re: removing double quotes using strpbrk()

 
0
  #5
Oct 9th, 2006
Thanks you are a legend it works now. thanks.
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC