From: matz@... (Yukihiro Matsumoto) Date: 2001-08-31T17:36:17+09:00 Subject: [ruby-talk:20611] Re: String.subst[!] RCR Hi, In message "[ruby-talk:20607] Re: String.subst[!] RCR" on 01/08/31, Yukihiro Matsumoto writes: ||I'm sure it _is_ faster ... but I believe that's it because of subst is ||written in ruby, while sub is in C. | |I meant RE substitute can be as fast as C implemeted subst. By the way, if you can live with single substitution (i.e. "sub", not "gsub"), you can use String#[]= with string index. a = "abcdef" a["cd"] = "CD" matz.