String::replace_first
String::replace_last
Rebased and modified by zachs18. Co-authored-by: zachs18 <8355914+zachs18@users.noreply.github.com>