Go4Expert

Go4Expert (http://www.go4expert.com/)
-   C (http://www.go4expert.com/forums/c/)
-   -   Removing/substituting words in a string HELP! (http://www.go4expert.com/forums/removing-substituting-words-string-help-t614/)

sg57 7Mar2006 11:04

Removing/substituting words in a string HELP!
 
I am trying to make a small AIM app, so far I can connect to the internet and get IMs, not send yet, but get. Now, when recieving, I get the message in HTML coding, I want to for now remove those words:

Code:

<HTML><FONT>Hey</FONT></HTML>
Now, what string manipulative can I use to remove the words/HTML coding? Is it like a strmove function that will move the words to another buffer I do not want to display? Please help as this is a somewhat AIM client for hte PSP. I am using just C, unless C and C++ will co operate together? I dunno, I just need an answer to my question, thanks.

shabbir 7Mar2006 11:21

Re: Removing/substituting words in a string HELP!
 
First of all welcome to www.go4expert.com

This can be done by just parsing the character array that contains the output. Search for < and move from the next character till the > if you find matching < and > remove discard the string.

sg57 7Mar2006 11:46

Re: Removing/substituting words in a string HELP!
 
Hmmmm... Ok, parsing, thanks, I had heard that somewhere, but never had thought to use it, thanks for the answer and how quick it was. Now I can simply use a token to remove un-useable characters. An example is machine code that is generated by the Null (0x00) character. This also can be used for 'smilies' I assume? Simply instead of removing the certain 'characters' just replace them with an image, simple.

Thanks, Ill be sure to refer this site to some other developers in need of some help! :o

shabbir 7Mar2006 14:14

Re: Removing/substituting words in a string HELP!
 
Quote:

Originally Posted by sg57
Hmmmm... Ok, parsing, thanks, I had heard that somewhere, but never had thought to use it, thanks for the answer and how quick it was. Now I can simply use a token to remove un-useable characters. An example is machine code that is generated by the Null (0x00) character. This also can be used for 'smilies' I assume? Simply instead of removing the certain 'characters' just replace them with an image, simple.

Thanks, Ill be sure to refer this site to some other developers in need of some help! :o

Yeah. Replacing them with NULL is also not a bad option.

sg57 8Mar2006 06:40

Re: Removing/substituting words in a string HELP!
 
That might be better actually, use a prototype (change whatever words I want to the Null character) then use that strtok function/prototype to remove all Null characters. Just need to parse the string characters all together, then proceeed.

coderzone 8Mar2006 07:03

Re: Removing/substituting words in a string HELP!
 
Quote:

Originally Posted by sg57
That might be better actually, use a prototype (change whatever words I want to the Null character) then use that strtok function/prototype to remove all Null characters. Just need to parse the string characters all together, then proceeed.

Actually I agree.


All times are GMT +5.5. The time now is 04:54.