how check if String has Full width character in java

后端 未结 4 1636
失恋的感觉
失恋的感觉 2021-01-12 16:48

Can anyone suggest me how to check if a String contains full width characters in Java? Characters having full width are special characters.

4条回答
  •  隐瞒了意图╮
    2021-01-12 17:20

    You can compare the UNICODE Since unicode for alphabets (a-z) is 97-122 , So you can easily diffrentiate between the two

    String str="abc@gmail.com";
    System.out.println((int)str.charAt(0));
    

    for Input

    abc@gmail.com
    

    Output

    65345
    

提交回复
热议问题