I am trying to remove the trailing numbers from the string using JavaScript RegExp. Here is the example.
Input output ------------------------- st
Use .replace():
.replace()
"string".replace(/\d+$/, '')
A simple demo jsfiddle: http://jsfiddle.net/v8xvrze0/