Comments

3 comments

  • Martin Evans

    This will work for you:

    var text = "Proposal #33126 -";

    text.replace(/.*#|\s*-.*$/g, '');

    0
    Comment actions Permalink
  • Rainer Grabowski

    In your code add as last line:

    extractedNumber

    Or remove in your last line

    var extractedNumber = 

    This one is shorter:

    Number(inputString.split('#')[1].split('-")[0])
    0
    Comment actions Permalink
  • Phil Dangerfield

    Awesome this solution worked! thanks for the input!

    0
    Comment actions Permalink

Please sign in to leave a comment.

Powered by Zendesk