I can't seem to find any solutions for this with just using String
methods in Java. Having trouble trying to get the string out...
Heres my code:
import java.util.Scanner;
public class lab5_4
{
public static void main(String[]args)
{
Scanner scan = new Scanner(System.in);
System.out.println("Enter a sentence");
String s= scan.nextLine();
String s2 = s.toLowerCase();
for( int count = 0; count<= s2.length()-1; count++)
{
if( s2.charAt(count)==' ')
{
String s3 = s2.substring(count,count+1);
String s4= s3.toUpperCase();
System.out.print(s4);
}
}
}
}