Fixed
Details
Assignee
Michael OffnerMichael OffnerReporter
Zac SpitzerZac SpitzerLabels
New Issue warning screen
Before you create a new Issue, please post to the mailing list first https://dev.lucee.org
Once the issue has been verified, one of the Lucee team will ask you to file an issue
Sprint
Fix versions
Affects versions
Priority
New
Details
Details
Assignee
Michael Offner
Michael OffnerReporter
Zac Spitzer
Zac SpitzerLabels
New Issue warning screen
Before you create a new Issue, please post to the mailing list first https://dev.lucee.org
Once the issue has been verified, one of the Lucee team will ask you to file an issue
Sprint
Fix versions
Affects versions
Priority
Created 18 August 2022 at 13:01
Updated 20 February 2024 at 10:00
Resolved 20 February 2024 at 10:00
https://trycf.com/gist/faf488549f72d9a4324830c61ab8e8c0/lucee5?theme=monokai
<cfscript> input = 'aaa bbb & İkra'; toReplace = 'aaa bbb & İkra'; newStr="aaa bbb;İkra"; function replaceNoCaseCustom(required string input, required string toReplace, required string newStr) { var offset = find( lcase( arguments.toReplace ), lcase( arguments.input ) ); if ( offset == 0 ){ return arguments.input; } else { if ( offset == 1 ){ return arguments.newStr & mid( arguments.input, len( arguments.toReplace ) + 1 ); } else { var s = left( arguments.input, offset - 1 ) & arguments.newStr; if ( ( len( arguments.toReplace ) + offset ) lt len( arguments.input ) ){ s =s & mid( arguments.input, offset + len( arguments.toReplace ) ); } return s; } } } dump(replaceNoCase(input, toReplace, newStr)); // aaa bbb & İkra dump(replaceNoCaseCustom(input, toReplace, newStr)); // aaa bbb;İkra </cfscript>