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

Popular posts from this blog

ruby - Trying to change last to "x"s to 23 -

jquery - Clone last and append item to closest class -

c - Unrecognised emulation mode: elf_i386 on MinGW32 -