Google CodeSearch

Wednesday, October 11, 2006 3:03:12 PM (Central Standard Time, UTC-06:00)

Google introduced Code Search about a week ago.  It doesn't look like it actually will pull code snippets from blogs or html, but it pulls from sources that are not typically cataloged by crawlers... such as archive files.  I have already found it useful a number of times.

Lets say you want a function to convert a string to pascal case... you know this function has been written a thousands times before so you hit Google.

Google Search on 'c# pascalcase'

There is a bunch of hits on coding standards but no function that actually converts a string to pascal case on the first page.

Now try it on code search...

Google Code Search on 'lang:c# pascalcase'

Right away you find the code you are looking for.

Tuesday, October 17, 2006 10:04:08 AM (Central Standard Time, UTC-06:00)
It did not find any dictionary based PascalCase converters. I think it should be something more than this:

static string PascalCase(string myString)
{
if (String.IsNullOrEmpty(myString))
return myString;

return Char.ToUpper(myString[0]) + name.Substring(1);
}
Tuesday, October 17, 2006 12:17:45 PM (Central Standard Time, UTC-06:00)
Here is a better one (not dictionary based) but better implementation.

http://www.google.com/codesearch?q=+pascalcase+show:2X3eCzMmeBI:23AbcC5a-oo:2Md3WhVK_gA&sa=N&cd=20&ct=rc&cs_p=http://svn.nlog-project.org/snapshots/sooda-latest.tar.bz2&cs_f=trunk/Sooda/src/SoodaSchemaTool/MSSqlSchemaImporter.cs#a0
Shannon
Comments are closed.