Ruby On Count words in a string

by andyjeffries, July 22, 2009 20:21

Tj wrote:
"PS. if you think...

5cb7a05b6de4a6655319db9333be429c Talk
require 'net/http'

namespace :static do
...

Ruby On Get action response

by andyjeffries, July 22, 2009 12:18

I've only refactored out th...

5cb7a05b6de4a6655319db9333be429c Talk
def toll_free_dealer_phone(phone)
  phone.gsub(/^(866|877|888)/, '1-\1')
end

Ruby On Add 1- in front of a number

by andyjeffries, July 22, 2009 12:17

A simple gsub on the string...

5cb7a05b6de4a6655319db9333be429c Talk
s = "The green hat is the twin of the green hat"
h = Hash.new(0)
s.split.each do |w|
...

Ruby Count words in a string

by andyjeffries, May 02, 2009 13:41, 16 refactorings, tagged with hash, string strip, simple

This is a coding question I...

5cb7a05b6de4a6655319db9333be429c Talk