myString = "my lucky numbers are 6, 8, and 19."
I'm calling myString.remove("ra6"), and this should return "my lucky numbes e 6, 8, nd 19".
Here's what I'm trying to do.
public String remove(String arg) {
if (myString != null) {
char[] arrayOfChars1 = myString.toCharArray();
char[] arrayOfChars2 = arg.toCharArray();
char[] newArray =
}
return null;
}
I'm trying to create an arrayOfChars1 so that I can compare it to the given String which would be another arrayOfChars2.
and a third array to store the comparison. If a char is in both array (arrayOfChar1 and arrayOfChar2) is found it should be removed but only the alphabets not numbers.
myString = "my lucky numbers are 6, 8, and 19."
myString.remove("ra6") //6 should be ignored.
return "my lucky numbe(r)s (a)(r)e 6, 8, and 19."
only char 'a' and 'r' should be removed