我试着去弄清楚如何验证用户input.I希望用户输入 像A1或B6.The输入应在以下模式。从一个字母到h后跟一个 从1数到8,串号]。也信宜被接受或者如果是资本要么not.Here是我code.Any帮助是非常感谢!验证字符串格式(模式)输入
private void getUserInput() {
Scanner scan = new Scanner(System.in);
userGuess1 = scan.nextLine();
// Here i should validate if the input is in the right format
userGuess = userGuess1;
谢谢你的时间和解释this.Hope它也帮助其他同样的问题! – Kisos 2014-10-27 23:20:47