java - Allow string contains specific char from string -


i want check string if contains specific char string.

how can in java?

thank you.

example:

string inputstring =hi, how you?"; string allowchar ="abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz,.?!0123456789 "; 

use : inputstring.matches("["+allowchar+"]+") check if inputstring contains characters mentioned in allowchar tring


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -