How to check whether given string is a word

前端 未结 6 1083
礼貌的吻别
礼貌的吻别 2020-12-02 00:51

Hello I am developing a word game where i want to check the user input as valid word or not please suggest the way i can check the given string in android.

Eg . Str

6条回答
  •  北海茫月
    2020-12-02 01:17

    if(s.equals("word from dictionary in loop"){
        //action
    }
    

    and it's also good to

    s = s.toLowerCase();
    

    so there would be no matter how "pokemon" is the entry word

提交回复
热议问题