// A program from Chapter 9 of Sams Teach Yourself Java in 24 Hours // by Rogers Cadenhead, http://www.java24hours.com/ package com.java24hours; class SpaceRemover { public static void main(String[] arguments) { String mostFamous = "Rudolph the Red-Nosed Reindeer"; char[] mfl = mostFamous.toCharArray(); for (int dex = 0; dex < mfl.length; dex++) { char current = mfl[dex]; if (current != ' ') { System.out.print(current); } else { System.out.print('.'); } } System.out.println(); } }