Refactor string.c Fix#2267

Revert changes  using STR_LEN(), RSTRING_PTR()