Check String whether it contains only Latin characters?

前端 未结 6 1937
感动是毒
感动是毒 2021-01-01 21:36

Greetings,

I am developing GWT application where user can enter his details in Japanese. But the \'userid\' and \'password\' should only contain English characters(L

6条回答
  •  感情败类
    2021-01-01 21:48

    There is my solution and it is working excellent

    public static boolean isStringContainsLatinCharactersOnly(final String iStringToCheck)
    {
        return iStringToCheck.matches("^[a-zA-Z0-9.]+$");
    }
    

提交回复
热议问题