Trying to use strip()
method to get rid of white spaces around a string and for some reason strip()
doesn't work. The error I get is "The method strip()
is undefined for the type String".
String fullAd = " Hello World ";
System.out.println(fullAd.strip());