I'm trying to take a string as an input (around 5 - 7 characters), iterate through each character and check whether or not it matches a character from an array. For example:
static String Registration(String reg) {
int[] numbers = {0, 1, 2, 3, 4, 5, 6, 7 , 8, 9,};
if (reg.length() >= 7) {
for (int i = 0; i < reg.length(); i++) {
reg.indexOf(numbers[i]);
}
}
}
The above is clearly wrong. However, I hope it illustrates what I'm trying to do. For example, if the string was "H3llo", I would want to check each character in the string and see if it matches with any items in the array. If it does, I would like to store the index as an int.
This is probably not an efficient way of doing it, but it's the only way I can think of with my current level of learning.
Regular Expressionshas standardizedregex.