.replace(..)
method calls RS-P1007Multiple consecutive replace(..)
calls with the same replacement text can result in poor performance. Oftentimes, these replace
calls can be merged.
Consider using .replace(|c| matches!(c, <ch> | <ch>), <replacement>)
.
"this is a string"
.replace('i', "z")
.replace('t', "z")
"this is a string"
.replace(|c| matches!(c, 'i' | 't'), "z")