public static String googleMe(String command) { List word = new ArrayList(); String url = "https://www.google.com/search?q="; for (String singleWord : command.split(" ")) { word.add(singleWord); } if (word.get(0).toLowerCase().equals("google")) { for (int i = 1; i < word.size(); i++) { url += urlencode(word.get(i)) + "+"; } return url; } return ""; }