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

22
LINES

< > BotCompany Repo | #1002054 // googleMe (C#)

Document

public static string googleMe(string command)
        {
            List<string> word = new List<string>();
            string url = "https://www.google.com/search?q=";

            foreach (string singleWord in command.Split(' '))
            {
                word.Add(singleWord);
            }

            if (word[0].ToLower().Equals("google"))
            {
                for (int i = 1; i < word.Count; i++)
                {
                    url += Uri.EscapeDataString(word[i]) + "+";
                }
                return url;
                
            }
            return "";
 
          }

Author comment

by @awerageguy

download  show line numbers   

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

No comments. add comment

Snippet ID: #1002054
Snippet name: googleMe (C#)
Eternal ID of this version: #1002054/1
Text MD5: 777b0309c628f4873ad8f36f4016cc59
Author: stefan
Category:
Type: Document
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2015-12-18 00:41:47
Source code size: 634 bytes / 22 lines
Pitched / IR pitched: No / Yes
Views / Downloads: 594 / 355
Referenced in: #1002056 - C# to JavaX Translator (googleMe function) - WORKS
#1002057 - googleMe function - JavaX auto-conversion from C#
#3000188 - Answer for stefanreich(>> t search)
#3000382 - Answer for ferdie (>> t = 1, f = 0)
#3000383 - Answer for funkoverflow (>> t=1, f=0 okay)