How do I obtain a trimmed down inputted text ?
eg,
var txt = “Hello, how are you???”;
To produce result like :
” how are you”
Here, I would like to remove the earlier “Hello,” part and remove the later “???” part. I cannot directly use the character positions because it could be any word before comma which user inputs.
You can remove everything up to the comma using a regular exprssion:
You can remove any trailing question marks using:
and you can combine them using: