Quantcast
Channel: Get everything after the dash in a string in JavaScript - Stack Overflow
Viewing all articles
Browse latest Browse all 15

Answer by artlung for Get everything after the dash in a string in JavaScript

$
0
0

How I would do this:

// function you can use:function getSecondPart(str) {    return str.split('-')[1];}// use the function:alert(getSecondPart("sometext-20202"));

Viewing all articles
Browse latest Browse all 15

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>