given a JS variable like:
var n = James Bond;
var n = James Earl Bond;
var n = James;
How can I return the first name plus last initial? While account for ignoring the middle name and the possibility of their only being a first name? Anyone solve this elegantly before?
Thanks
Here’s the fiddle: http://jsfiddle.net/68JVS/