I am trying to read in a file and change the first letter of the first word to uppercase and then change the second word to upperCase and so on. Also, I need to delete all the spaces in between. Example:

Contol Measure Mapping (needs to look like) controlMeasureMapping

If anyone can assist me, I would really appreciate it. I will provide the code where I am stuck below.

import java.io.*;
import javax.swing.*;

class BufferReaderDemo {

public static void main(String args[]) {

try {
FileReader fr = new FileReader("C:\\Documents and Settings\\rwhitehurst\\Desktop\\Test.txt");
BufferedReader br = new BufferedReader(fr);

String s;

int ToCharArray[] = new int[4];
String output = "Index\tValue\n";

while((s = br.readLine()) != null){
if (s.length() > 0)



catch(Exception e) {
System.out.println("Exception: " + e);