As the title says, I am looking for help checking if a string contains special characters or spaces (but allowing hyphens, except at the end of the string) in javascript.
For example, if a string is 'laskdfja saldfja sldkfj alsd#$@ @#$KL@ @KL$', return true, and if a string is 'dskfj-dflsk' return false, or 'sdkfj-' return true.
Can anyone help? Thanks in advance?