Its startsWith, you forget an "s", but I'd also solve it in the same way, there is also no need to check for length as if it's shorter if would also give a false. (I tried it and it worked for me) Btw if my understanding is correct the question asked for to "return" the strings red and blue, not print them. I made a public static String function and I returned the strings.
why did u not use myString.startWith(String) function in first part?
Its startsWith, you forget an "s", but I'd also solve it in the same way, there is also no need to check for length as if it's shorter if would also give a false. (I tried it and it worked for me)
Btw if my understanding is correct the question asked for to "return" the strings red and blue, not print them. I made a public static String function and I returned the strings.