944,120 Members | Top Members by Rank

Ad:
  • C Discussion Thread
  • Marked Solved
  • Views: 4275
  • C RSS
Oct 9th, 2006
0

removing double quotes using strpbrk()

Expand Post »
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 = ' ';
}
Similar Threads
Reputation Points: 31
Solved Threads: 0
Light Poster
hariza is offline Offline
38 posts
since Sep 2006
Oct 9th, 2006
0

Re: removing double quotes using strpbrk()

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.
Sponsor
Team Colleague
Featured Poster
Reputation Points: 5608
Solved Threads: 2283
Retired and Enjoying Life
Ancient Dragon is offline Offline
21,961 posts
since Aug 2005
Oct 9th, 2006
0

Re: removing double quotes using strpbrk()

hi There,

I tried but I'm getting:
unknown escape sequence '\<'
Reputation Points: 31
Solved Threads: 0
Light Poster
hariza is offline Offline
38 posts
since Sep 2006
Oct 9th, 2006
0

Re: removing double quotes using strpbrk()

yes, I knew that would happen. Please look at my post very carefully because I showed you the correction -- two '\' characters.
Sponsor
Team Colleague
Featured Poster
Reputation Points: 5608
Solved Threads: 2283
Retired and Enjoying Life
Ancient Dragon is offline Offline
21,961 posts
since Aug 2005
Oct 9th, 2006
0

Re: removing double quotes using strpbrk()

Thanks you are a legend it works now. thanks.
Reputation Points: 31
Solved Threads: 0
Light Poster
hariza is offline Offline
38 posts
since Sep 2006

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C Forum Timeline: Drawing shapes with a while statement
Next Thread in C Forum Timeline: while loop





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC