That'll replace spaces in string literals as well.

On Aug 4, 9:43 pm, Kyle Renfro <kyleren...@gmail.com> wrote:
> Great contest!
> 1 pass required.
>
> Here is a very handy loop that *everyone* should use. ha ha.
>
> import java.io.*;
> import java.util.logging.*;
>
> public class AddTabs {
>
>     public static void main(String[] args){
>
>         try {
>             BufferedReader in = new BufferedReader(new
> InputStreamReader(System.in));
>             PrintWriter out = new PrintWriter(new
> OutputStreamWriter(System.out));
>             String s = in.readLine();
>             while (s != null){
>                 out.println(s.replaceAll("    ", "\t"));
>                 s = in.readLine();
>             }
>             in.close();
>             out.close();
>         }
>         catch (IOException ex) {
>
> Logger.getLogger(AddTabs.class.getName()).log(Level.SEVERE, null, ex);
>         }
>     }
>
>
>
> }

-- 
You received this message because you are subscribed to the Google Groups "The 
Java Posse" group.
To post to this group, send email to javapo...@googlegroups.com.
To unsubscribe from this group, send email to 
javaposse+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/javaposse?hl=en.

Reply via email to