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

java - Incorrect order of records in M-M relationship in hibernate -

command line - Use qwinsta in PowerShell ISE -

php - I want to create a website for polls/survey like this http://www.poll-maker.com/ -