You can use split
method for it. And if you should take string from specific pattern you can use split
with req. exp.:
var string = "sometext-20202";console.log(string.split(/-(.*)/)[1])
You can use split
method for it. And if you should take string from specific pattern you can use split
with req. exp.:
var string = "sometext-20202";console.log(string.split(/-(.*)/)[1])