hankknight
asked on
JavaScript: Remove everything after certain characters
Using JavaScript, how can I remove everything after the last one of these characters?
. ? ' ! "
. ? ' ! "
var str = 'This is a test. It is a'; // should become: This is a test.
var str = 'This is a test! Hello'; // should become: This is a test!
var str = 'This is a "test." 123'; // should become: This is a "test."
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.