I want to find a character within a string. If the character is found, add one to char_counter. How can I implement this?
Example:
int char_counter = 0;
String password = "1234";
String search = "1234";
for(int i = 0; i < password.length() - 1; i++) {
for(int j = 0; j < search.length() - 1; j++) {
//This is just pseudo code since I don't know how to properly search a string
if(password[i] == search[j]) {
char_counter = char_counter + 1;
}
}
}