From: Rick DeNatale Date: 2010-05-06T21:37:11+09:00 Subject: Re: How can I call String#replace (rb_str_replace()) in C API? On Thu, May 6, 2010 at 12:45 AM, James Masters wrote: > Thanks for the advice :).  Yeah, I was actually thinking about > allocating another Ruby string and doing something similar to what > rb_str_replace does to avoid crashing and GC issues.  But it will > still be tricky.  I wish that this was easier... You could use rb_intern and rb_funcall* VALUE origin_str; VALUE replacement_str; ID replace_id = rb_intern("replace"); rb_funcall(orig_string, replace_id, 1, replacement_str); -- Rick DeNatale Blog: http://talklikeaduck.denhaven2.com/ Github: http://github.com/rubyredrick Twitter: @RickDeNatale WWR: http://www.workingwithrails.com/person/9021-rick-denatale LinkedIn: http://www.linkedin.com/in/rickdenatale