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

Capture and play voice with Asterisk ARI -

visual studio - Installing Packages through Nuget - "Central Directory corrupt" -

java - Why database contraints in HSQLDB are only checked during a commit when using transactions in Hibernate? -