def append
  string = ''
  5.times do
...

Ruby append string in iterator

by ololo777.myopenid.com, July 15, 2011 05:06, 4 refactorings, tagged with string, ruby

not good enough(

55502f40dc8b7c769880b10874abc9d0 Talk
def parse_query(s)
  if s.count(':') == 0
    return s
...

Ruby Parsing key value with no d...

by theshionak, February 22, 2011 19:21, 9 refactorings, tagged with string, ruby, regex, parse

Input: "the big state:activ...

38ad07c474f260c81ca64a66edfe446e Talk
class String
  
  def titlecap
...

Ruby Ruby Title Caps method

by SmackTurtle, October 05, 2010 21:06, 7 refactorings, tagged with string, ruby, Capitalize, titlecaps, dangerous

Capitalizes the first lette...

6572fa57acbc8588e27f95f2592d9048 Talk
def dedent()
            sRaw    =   self;
            sep     =   "\n";
...

Ruby ruby dedent whitespace in a...

by dreftymac.myopenid.com, March 05, 2010 16:37, 4 refactorings, tagged with string, ruby, monkeypatch

Remove leading whitespace f...

55502f40dc8b7c769880b10874abc9d0 Talk
def compress(source)
    source.gsub!(/\s+/, " ") # collapse space
    source.gsub!(/\/\*(.*?)\*\//, "") # remove comments - caution, might want to remove this if using css hacks
...

Ruby Gsubing

by marko.z, October 31, 2008 09:44, 2 refactorings, tagged with string, ruby, css, gsub

There is a lot of repetitio...

Bd9893bfd15fa7b443d112607b937734 Talk
class Race < ActiveRecord::Base
  
...

Ruby Help generating abbreviatio...

by Michael Filbin, April 06, 2008 16:16, 3 refactorings, tagged with string, model, abbreviation, attribute

Hi all,

I am attempting ...

14b8667b3bdf64068647b96c26001e0d Talk
class String 
  def postal?  
    self.match(/[a-zA-Z]{1}\d{1}[a-zA-Z]{1}([\x20-])*\d{1}[a-zA-Z]{1}\d{1}/) ? true : false
...

Ruby Is This String Postal?

by Gary Haran, October 30, 2007 15:29, 9 refactorings, tagged with string, class, postal

We've had the debate over w...

403e57e2be130d2218f992b86dfa8260 Talk