Check a string with a character array and check if the string has only those characters mentioned in the array-JAVA

I want to develop a Java code for the scenario I mentioned below,

Suppose I need to get an input from the user and check with a predefined character array. The program must check the input from the user whether it contains only those characters that I have predefined in the character array.


I have an character array as,

char original[]={'a','b','c','d'};

I get an input from the user as,

type your word: dam

Here, the program must check each characters in the array(**With case sensitive) with the string and must say, "this is not...

Read More »

By: StackOverFlow - Wednesday, 7 November

Related Posts