I am trying to make a java script for a mobile app check if a string contains specific characters.
if(fn.contains(" ")){
}
The fn
variable is declared twice in the following:
private EditText fn;
final EditText fn = (EditText) findViewById(R.id.fn);
Not sure why this doesn't work. In android studio, the contains
function highlights red as it doesn't exist. You can click here to see what I am talking about. Is there another method than this?