@replace works case sensitive

#1
Yesterday I became almost desperate because @replacing strings did not work (as expected).
I was really doubtful about my mind - until I RTFM.
Of course @replace works case sensitive, but what I want to ask:
Is there a way to bypass this or
perhaps the possibility to enhance @replace with a "case insensitive - switch"?
 
Sep 11, 2012
81
1
#2
Perhaps a function linke this ?

ireplace=%@replace[%1,%2,%@upper[%3]]

Test:

echo %@ireplace[ABC,abc,"Test AbC"]

Result: Test abc

echo %@ireplace[ABC,abc,"Test abC"]
Result: Test abc
Is that your goal ?
 
Sep 11, 2012
81
1
#3
Perhaps a function like this ?
ireplace=%@replace[%1,%2,%@upper[%3]]
Test:
echo %@ireplace[ABC,abc,"Test AbC"]
Result: Test abc
echo %@ireplace[ABC,abc,"Test abC"]
Result: Test abc
Is that your goal ?
 
#4
Hello Stein,

that's a cool idea and actually what I want. It would also work with tcc/le without functions if I "upper" the 3rd parameter before the @replace. Thank you.

But even more elegant would be an "ignore case" switch. ;)