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

> Thanks for the advice :). =A0Yeah, 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. =A0But it will
> still be tricky. =A0I wish that this was easier...

You could use rb_intern and rb_funcall*

VALUE origin_str;
VALUE replacement_str;
ID replace_id =3D rb_intern("replace");

rb_funcall(orig_string, replace_id, 1, replacement_str);

--=20
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