admin on October 2nd, 2008

Utilize a simple extension method to capitalize the first letter of a string.

public class Program
    {
        static void Main(string[] args)
        {
            string s = “toUpperFirstLetter”;
            // ToUpperFirstLetter is the extension method defined below
            [...]

Continue reading about C# To Upper Case First Letter of a String

admin on September 20th, 2008

Pointer usage in C#, it must be in unsafe context

static unsafe void Main()
{
    int i;
    int[] array = { 11, 22, 33 };

    // pointer pi has the address of variable i
    int* pi = & i;
    // ppi(addess of pi) < pi(addess of i) < i(0)
    i = [...]

Continue reading about C# Pointer in unsafe context