I am new to Java and I am currently learning about String Manipulation with Java in school.
I have the below program which displays the string entered, the length of the string a user-entered, and where the first space in our string is. (No exception handler)
Scanner in = new Scanner(System.in);
System.out.println("Please enter your string of words, sentences, or both!");
String entrypoint = in.nextLine();
System.out.println(entrypoint);
int manippointone = entrypoint.length();
System.out.println("Your string is " + manippointone + " characters long.");
int maniptwo = entrypoint.indexOf(" ");
System.out.print("Found the first space in your string at character number: " + (maniptwo + 1));
I have compiled and run the program and it works fine. The issue is on to the more complicated part which needs me to do the following:
Display the word after the 3rd space in your initial string Display the string from index 12 to the end of the string
I understand indexOf() along with charAt() but I am having trouble with those two parts of this assignment. Any help would be greatly appreciated.