I want to write a C# extension method to convert from Python style variables (strings) to .NET style, for example:

```
"student_name" => "StudentName"

```

This is the extension method that I have written:

```
public static string PythonToDotNetStyle(this string str)
{
    var words = str.Split(new char[] { '_' });
    for (int i = 0; i < words.Length; i++)
    {
        words[i] = Thread.CurrentThread.CurrentCulture.TextInfo.ToTitleCase(words[i]);
    }

    return string.Join(string.Empty, words);
}

```

I am wondering if there is a more elegant way to write this logic?