XCOMMONS-648: Provide API to double a char in a string

(cherry picked from commit 177d2ff7cdfd93520ded871bf5f3286581141605)