Contains method in java doesn't exist? : I am trying to make a java script for a mobile app check if a string contains specific characters.

    if(fn.contains(" ")){

    }

Not sure why this doesn't work. In android studio, the 'contains' function highlights red as it doesn't exist. You can click [here][1] to see what I am talking about. Is there another method than this?


  [1]: https://i.stack.imgur.com/6whGy.png