regexp on String object

Jul 06
2008

Some of the more rarely used string methods:

str = "the tester"
 
str["tester"] #true, the String contains "tester"
str[/\w+\s\w+/] #true, the String matches the regexp

emulates capitalize!

str[/(\w+)/] = ($1[0] - 32).chr

RDoc Documentation

Comments are closed.

Calendar

July 2008
M T W T F S S
« Jun   Aug »
 123456
78910111213
14151617181920
21222324252627
28293031  

Tags