Backport Add replace and deleteCharAt methods to StringBuilder and StringBuffer

(cherry picked from commit 20973bc986ccaf78082e00dd0fd7380a9c630cac)