I am trying to incorporate a splice such that it tests for 2 things:
- Characters cannot be longer than 20, removes the rest
- It stops at the first non-alpha-numerical, removes the rest ?
How would I go about doing this ? i.e. for example
var string = 'Special Place Co. (123 ABC)'
So this would return
‘Special Place Co’ [found ‘.’ and removed spliced after]
Thanks
Here is a code that will work for you:
http://jsfiddle.net/U5ZtU/