javascript - get characters up to first occurrence of 'x' from reverse -
i want split string first occurrence of 'dot' right left match.
//if have input string follows var string = "hi.how.you" ; //i need output following output="you";
you can split
dot , use pop()
last element of resulting array:
var string = "hi.how.you" ; var last = string.split('.').pop() //=>
Comments
Post a Comment