summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Bratch <l_bratch@yahoo.co.uk>2010-11-01 13:25:40 +0000
committerLuke Bratch <l_bratch@yahoo.co.uk>2010-11-01 13:25:40 +0000
commit693d152df03435f8e6ca65811104e2df0ff80286 (patch)
treeb73cc0880936c5cc1c773e65b1e76c1161eff5cf
parent911eeaac874985168aee56a3f06bad1c59f1c207 (diff)
Don't output query, don't output trailing |, do output trailing \n
-rw-r--r--blasearch.java7
1 files 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");
}
}