Friday, April 21, 2006 8:00 PM Erwyn van der Meer

Is Visual Basic case sensitive?!

Ever since confessing I am being attracted to the dark side, I have hated the idea of having to give up the case sensitivity that I know and love from such languages as C#, Java, C++ and JavaScript.

But on Michael Kaplan's blog I found something that might puzzle even the most addicted VB fan. What does this code print when run?

Module Module1

    Sub Main()
        Call Pröcedure1()
    End Sub

    Sub Pröcedure1()
        Console.WriteLine("Schrödinger's cat is not dead.")
    End Sub

    Sub PRÖCEDURE1()
        Console.WriteLine("Schrödinger's cat is dead.")
    End Sub

End Module

Nope, it doesn't produce a compiler error as you might expect. Give your guess here as a comment and then head over to Michael's blog for the answer. To try it out yourself in Visual Studio copy-and-paste the code in Module1.vb in a freshly created Visual Basic console application project.
Filed under:

# re: Is Visual Basic case sensitive?!

Wednesday, September 19, 2007 7:16 AM by Yogesh Bhute

I think VB is Case Sensitive language becoz it automatically adjusts its cases in smalls & caps.