On Thu, May 6, 2010 at 12:45 AM, James Masters
<james.d.masters / gmail.com> wrote:

> Thanks for the advice :).     > allocating another Ruby string and doing something similar to what
> rb_str_replace does to avoid crashing and GC issues.    
> still be tricky.      
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