Hi everyone,
This is my first time posting on this forum, as i've only recently started studying java. I'm still learning the basics and I'm having difficulty trying to solve a certain problem from one of my worksheets.Here is the question.
Many word-processors can check spelling. One of the corrections applied is to swap 'e' for 'i' if 'i' occurs immediately before 'e' and immediately after 'c'. For example, concieve is corrected to conceive. Write a program that carries out this correction. That is, your program should read a string and print the corrected string (or the original string if no correction needed to be applied.)
First of all, I understand that these forums are to help, as oppose to giving people the exact answers so thats not why im posting it here. I'm just puzzled as to how to do this. I'm aware il need some sort of for loop and the charAt method to check the characters in the string, but how do I get the program to recognize if an 'i' comes before an 'e' and also how to swap those characters and return the correct spelling?
Thank you