Question

I have a string call abcfdhsfjkds-21947, and I want to get the value after the symbol -, how to do that?

Answer

1
2
var str = 'abcfdhsfjkds-21947';
var result = str.split('-').pop();

The result is the value you want.

Reference


This is the end of post