WinBatch® Technical Support Forum

All Things WinBatch => WinBatch => Topic started by: jtrask on September 03, 2014, 01:37:36 PM

Title: Case-Insensitive StrReplace
Post by: jtrask on September 03, 2014, 01:37:36 PM
Is there a (relatively) simple way to do a case-insensitive StrReplace?
Title: Re: Case-Insensitive StrReplace
Post by: JTaylor on September 03, 2014, 03:02:17 PM
BinaryReplace()?

Jim
Title: Re: Case-Insensitive StrReplace
Post by: jtrask on September 04, 2014, 08:43:07 AM
Thanks.  That worked.

I'd avoided creating a buffer because I've only done it once before, and that was years ago.  Once I jumped in, it proved much easier to do what I had been doing previously by reading a file line by line.
Title: Re: Case-Insensitive StrReplace
Post by: td on September 04, 2014, 09:23:04 AM
Just make sure that when your replacement string is longer than your search string, you allocate a buffer big enough to handle the maximum number of possible replacements plus the number of extra characters.   Of course, if your replacement string is never longer that your search string, never mind...