Project

General

Profile

« Previous | Next » 

Revision 10082360

Added by sonots (Naotoshi Seo) almost 7 years ago

string.c: add String#delete_prefix and String#delete_prefix!
to remove leading substr [Feature #12694] [fix GH-1632]

  • string.c (rb_str_delete_prefix_bang): add a new method
    to remove prefix destuctively.

  • string.c (rb_str_delete_prefix): add a new method
    to remove prefix non-destuctively.

  • test/ruby/test_string.rb: add tests.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59132 b2dd03c8-39d4-4d8f-98ff-823fe69b080e