From 693d152df03435f8e6ca65811104e2df0ff80286 Mon Sep 17 00:00:00 2001 From: Luke Bratch Date: Mon, 1 Nov 2010 13:25:40 +0000 Subject: Don't output query, don't output trailing |, do output trailing \n --- blasearch.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/blasearch.java b/blasearch.java index 8137fd0..9fbd1b5 100644 --- a/blasearch.java +++ b/blasearch.java @@ -39,7 +39,6 @@ public class blasearch { // Remove trailing + query = query.substring(0, query.length()-1); - System.out.println(query); String[] parts = null; //URL which provides XML response URL url = new URL("http://ajax.googleapis.com/ajax/services/search/web?v=1.0&q="+ query); @@ -73,10 +72,14 @@ public class blasearch { // Print results if(results != null){ for(int i=0; i<2; i++){ + if (i != 0) { + System.out.print(" | "); + } int count = i + 1; - System.out.print("Result " + count + ": " + results.get(i) + " | "); + System.out.print("Result " + count + ": " + results.get(i)); } } + System.out.print("\n"); } } -- cgit v1.2.3