String#sub instead String#gsub. Faster code.

Sub replaces only the first occurrence, while gsub all. More info at https://github.com/JuanitoFatas/fast-ruby#stringgsub-vs-stringsub-code.