I’m using the following code snippet:
Entity${0/(\w+)/\u\1/g}
This ensures the first character is uppercase and the rest is lowercase. How would I also ensure that hypens (-) and special characters are removed?
Thanks in advance.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Figured it out by doing the following:
Entity${0/(\w+)([-\s]*)/\u\1/g}At the moment, this only removes hypens (-). I’d like to remove all characters except alphanumeric characters.
If there’s a cleaner way, I’d be more than welcome to accept your answer instead.