我正在尝试做的是验证一些输入,以便输入必须以 2 个字母开头,后跟 3 个数字,但我找不到为此测试字符串的方法
boolean test;
String str;
str.format ("%s%s%d%d%d") //used this to give what the format was and was going to use it with a boolean, tried it in an if statement such as
if str.format = ("%s%s%d%d%d") then
{
test = true
}
else
{
test = false
}
我想知道我必须做些什么来实现这一目标?