I am trying to keep the tail end of the split
myLink = link.split(/\d/, 2)[1]
However the string it is splitting
link = 1 some text 800 hello world
would get split like:
1,
some text
I end up losing the tail end 800 hello world.
What can I do to keep this information.
This is because you are passing a limit of 2 to the split function so you are only getting two results in your split array. Omit the 2 and you’ll get them all: