如何確定數組是否包含 Java 中的特定值? - How do I determine whether an array contains a particular value in Java?

問題:

I have a String[] with values like so:我有一個String[]的值如下:

public static final String[] VALUES = new String[] {"AB","BC","CD","AE"};

Given String s , is there a good way of testing whether VALUES contains s ?給定String s ,是否有一種測試VALUES是否包含s的好方法?


解決方案:

參考一: https://en.stackoom.com/question/4jdD參考二: https://stackoom.com/question/4jdD
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章