[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: Dumb str.sub question

Austin Ziegler

11/26/2003 6:51:00 PM

str = "isn't stands for is not"
puts str.sub(/'/) { "\\\'" } #=> isn\'t stands for is not

After execution, irb prints an #inspect on the resulting object.

-austin
--
austin ziegler * austin@halostatue.ca * Toronto, ON, Canada
software designer * pragmatic programmer * 2003.11.26
* 13.48.12