How would I go about removing numbers and a space from the start of a string?
For example, from '13 Adam Court, Cannock' remove '13 '.
How would I go about removing numbers and a space from the start of a string?
For example, from '13 Adam Court, Cannock' remove '13 '.
Search for
/^[\s\d]+/
Replace with the empty string. Eg:
str = str.replace(/^[\s\d]+/, '');
This will remove digits and spaces in any order from the beginning of the string. For something that removes only a number followed by spaces, see BoltClock's answer.
var text = '13 Adam Court, Cannock';
var match = /\d+\s/.exec(text)[0];
text.replace(match,"");