ryan
12/08/2022, 10:17 AMreplaceNoCase
function, it does not keep the expected case of the search string after replacement.
The issue is that I want to replace 'app' with 'aPp'. Instead, it replaces 'app' with 'APP'.
Here is an example:
https://cffiddle.org/app/file?filepath=7a89e97a-846e-4c37-b96c-2ae8aaf9dbab/97001d3[…]266-9190-00db99167135/3989fe4a-fe71-43c0-a59d-4303754b8f59.cfm
Is there a way to manipulate strings with the exact casing in any way?ryan
12/08/2022, 10:38 AMScott Steinbeck
12/08/2022, 5:21 PMoutStr = replacenocase( myStr, "app", "aPp", "all");
Scott Steinbeck
12/08/2022, 5:25 PMapp
so the UCase(transform)
would uppercase all of it.
if you wanted to isolate the second character to uppercase it, it is possible to do so, but you may have to split the string into an array, or use regex with capture groupsryan
12/11/2022, 4:33 AMucase()
function was not meant to be in there. When the ucase()
is taken out, the same result happens where the replacement 'app' is all in upper case as 'APP'. I figured out how to resolve the issue and thank you for the suggestion to replace the inline function with the replacement string. I haven't tried that, yet, but I would prefer to do that instead of having the inline function in this case. Thanks for your feedback!
Here is the corrected link.
https://cffiddle.org/app/file?filepath=a59ae404-6540-4898-be9d-5e9fdee2979f/83d5e1c[…]aa6-9d1c-41414dad3c59/d022884b-887c-4a4f-a6e5-824c05467982.cfmgamesover
12/14/2022, 5:01 PMryan
12/20/2022, 11:59 AMreplacenocase
begins to error?gamesover
12/22/2022, 7:20 PM