I am trying to remove the input string from the public string myString
myString = "Hello"
removeS("el") will return "Hlo"
Heres my code below and the problem in it is incompatible types: java.lang.String cannot be converted to int in my String result. I would like it if you used substring() and indexOf() to solve my issue and not use any other power tools than those. How would I go about fixing this.
public class StringI
{
public String myString;
public String removeS(String s){
myString = "Hello";
String result = s.substring(myString);
return result;
}
public static void main(String args[]){
StringI n = new StringI();
n.removeS("el");
}
}