How to handle special character in query .My application is crash user add `:?.?);;;;`. I need to handle these characters. I want to show alert if user add this characters in text field?

Actually the problem is when user add this test in this field `:?.?);;;;`. I create the folder in director. Due to unable to create directory. It crash. How to handle this?