【发布时间】:2018-07-21 21:26:15
【问题描述】:
我试图弄清楚如何在下面的代码中接受用户输入的大小写字母。我的应用程序接受用户名的字符串,我需要能够让他们知道字符是否在其中,无论大小写如何。
boolean p=str.contains("R");
if(p)
System.out.println("string contains the char 'R'");
else
System.out.println("string does not contains the char 'R'");
【问题讨论】: