Hi all,
How could we validate that given string should only contains alphabetic characters,
pls share some ideas,
thanks in advance

Recommended Answers

All 3 Replies

  1. use the String matches(Regex) method with a regular expression for whatever you consider to be a letter in whatever languages you need to support.
  2. check each char in the String one at a time using Character's isLetter(char) method which knows about non-english characters.

thanks for the replies

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.