Hi guys,
I'm new and I'm totally stuck on a question for class! Basically we have to get the user to enter a few sentences and then change the first letter of every sentence to a capital version. I'll post my code below.
(I'm not asking for the answer just some help would be nice!)
import java.util.*;
public class CH10Q3
{
public static void main(String[] args)
{
String input;
Scanner keyboard = new Scanner(System.in);
System.out.println("Please enter a couple sentences");
input = keyboard.nextLine();
int periods=0;
while(periods!=-1)
{
System.out.println("While Start");
periods = input.indexOf('.', periods+3);
System.out.println(periods);
if(periods!=-1)
Character.toUpperCase(input.charAt(periods));
System.out.println("While End");
}
System.out.println(input);
}
}