Get string between two strings


/ Published in: Ruby
Save to your folder(s)

If you're using Rails and want to make this a global function, drop this into your application_controller and call it as a function.

Example:
# get_string_between("hellomyfriendmoto", 'o', 'm')
# > myfriend

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.