Domanda

Giusto quello che stavo cercando di fare è convalidare un input in modo che l'input debba iniziare con 2 lettere e seguito da 3 cifre, ma non riesco a trovare un modo per testare una stringa per questo

 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
}

Mi chiedo cosa dovrei fare per raggiungere questo obiettivo?

Nessuna soluzione corretta

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top