Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

20
LINES

< > BotCompany Repo | #1002060 // bingMe function

JavaX fragment (include)

1  
public static String bingMe(String command) {
2  
  List<String> word = new ArrayList<String>();
3  
  String url = "https://bing.com/search?q=";
4  
5  
  for (String singleWord : command.split(" "))
6  
  {
7  
      word.add(singleWord);
8  
  }
9  
10  
  if (word.get(0).toLowerCase().equals("bing"))
11  
            {
12  
                for (int i = 1; i < word.size(); i++)
13  
                {
14  
                    url += urlencode(word.get(i)) + "+";
15  
                }
16  
                return url;
17  
                
18  
            }
19  
  return "";
20  
}

Author comment

Began life as a copy of #1002057

download  show line numbers  debug dex  old transpilations   

Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, iveijnkanddl, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1002060
Snippet name: bingMe function
Eternal ID of this version: #1002060/1
Text MD5: 408cc8b202ec1535becd74e764e3c27a
Author: stefan
Category:
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2015-12-18 00:43:34
Source code size: 524 bytes / 20 lines
Pitched / IR pitched: No / Yes
Views / Downloads: 693 / 917
Referenced in: [show references]