gsub(/\Aprefix/, '')
can be replaced by delete_prefix('prefix')
RB-PR1026The delete_prefix('prefix')
method is faster than gsub(/\Aprefix/, '')
.
str.gsub(/\Aprefix/, '')
str.gsub!(/\Aprefix/, '')
str.gsub(/^prefix/, '')
str.gsub!(/^prefix/, '')
str.delete_prefix('prefix')
str.delete_prefix!('prefix')