Hi:
I have the following condition:
a = "some text\n"
b = “+ some more text\n”
I am trying to do the following in C:
a.chomp!
a << b[1…-1]
Right now I have
rb_funcall(a, rb_intern(“chop!”), 0, NULL);
// needs to remove ‘+’ from b
rb_str_append(a, b);
It is tempting to increment the internal pointer
of b by one and then append to a.
What I would like to avoid is having to create a
whole new string object with b[1…-1] just to lose it in
the append.
Can one of you Ruby C experts help me out here?
Thanks
···
–
Jim Freeze
Don’t change the reason, just change the excuses!
– Joe Cointment