Written by Sean Behan on Sun Jun 17th 2012

Here is a gist that demonstrates how easy it is to transform text using #gsub and a block with Ruby.

"Scs Epc Score".gsub (/scs|epc/i) { |i| i.upcase }
# => SCS EPC Score

For more helpful string extensions in Ruby check out our Ruby Gem on GitHub https://github.com/AgilionApps/rails_extensions


Tagged with..
#extensions #gsub #Rails #ruby #string #ruby

Just finishing up brewing up some fresh ground comments...