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

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

$
0
0

To use any delimiter and get first or second part

  //To divide string using deimeter - here @  //str: full string that is to be splitted  //delimeter: like '-'  //part number: 0 - for string befor delimiter , 1 - string after delimiter  getPartString(str, delimter, partNumber) {    return str.split(delimter)[partNumber];  }

Viewing all articles
Browse latest Browse all 15

Trending Articles



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