I assume this is as close as you get to C # in your python code.
using System;
using System.Net;
class Program
{
static void Main()
{
string word = "How to ask";
string source = (new WebClient()).DownloadString("http://stackoverflow.com/");
if(source.Contains(word))
Console.WriteLine("Found it " + word);
}
}
I'm not sure if re.search (#, #) is case sensitive or not. If not you could use ...
if(source.IndexOf(word, StringComparison.InvariantCultureIgnoreCase) > -1)
instead.
source
share