Substring replacement within a string
Posted on 2003-03-09
I currently have a replace substring function that I implemented to do just that replace all occurences of a substring in a given string. I am making use of this function in a c Library I am writing as part of an API I am developing. In any event the replace string function I am using is used extensively, and frequently (i.e might be a memory hog), thus I am wondering if someone might be able to provide me with an example of an EXTREMELY memory friendly replace substring function.... I thought mine was friendly, but lately I am wondering if it really is due to recent crashes I have been experiencing the more I make use of it.
One last thought is that under normal circumstances I would post the replace substring function that I am using, however, i developed it at work and since I work at a secure sight (i.e. no access from our internal network to the world, no floppy drives etc..). It makes it slightly difficult to share my code with you, without me rehashing and redevloping it on this internet machine, which by the way has no compiler for me to test it on anyway...
Anyway, could someone please provide me with an example of an extremely memory friendly replace substring function... Any suggestions, examples, code are greatly welcomed...
By the way this will be used on a Solaris machine, but should be pretty easy to implement using ANSI standard libraries... right???
Thanks in advance...