[DGD] Remove strings from strings

Erwin Harte harte at xs4all.nl
Mon Dec 3 06:52:23 CET 2001


On Mon, Dec 03, 2001 at 05:49:16AM +0000, Chooser fireman wrote:
> Just a quick question this time ...
> 
> I have a rather longs string and I need to remove an occurence of say 'Test' 
> 
> from it ... however, I don't know the position of it.
> 
> How can I go about remove 'Test' from the string?

Easy:

    string pre, post;

    if (sscanf(String1, "%sTest%s", pre, post) == 2) {
        String1 = pre + post;
    }

Regards,

Erwin.
-- 
Erwin Harte <harte at xs4all.nl>
_________________________________________________________________
List config page:  http://list.imaginary.com/mailman/listinfo/dgd



More information about the DGD mailing list