0

Hello,

I have a string taken as input from user. I just want to check if a particular character within that string, is part of Standard English character set or not.

How do I code the IF condition for this purpose?

Regards,
Arvind.

5
Contributors
4
Replies
6
Views
6 Years
Discussion Span
Last Post by AhmedGhazey
0

Forget if use for loop. Put all characters you want to check upon in a List, then with help of for loop go through word and check if List contains() that character.

0

Another way to check a single char.
Make it a String and use indexOf with a long String containing all the valid characters.

0

using .charAt(position ); you will get the i character in the String .

about checking is std English character you can check simply if the character fall between 'a' and 'z'

char c='a';
        if (c>='a'&&c<='z')
            System.out.println("Valid");
        else
            System.out.println("not Valid");

i hope i helped .

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.