IT SOLUTIONS
Your full service technology partner! 
-Collapse +Expand
To/From Code
-Collapse +Expand Cross Ref Guide
-Collapse +Expand Members-Only
Sign in to see member-only pages.
   ► KBTo/From GuidesC#  Print This     

Case Sensitivity (C# and JavaScript Cross Reference Guide)

By Mike Prestwood

C# versus JavaScript: A side by side comparison between C# and JavaScript.

 
Language Basics
 

Language basics is kind of a catch all for absolute beginner stuff. The items (common names) I chose for language basics is a bit random and include items like case sensitivity, commenting, declaring variables, etc.

Case Sensitivity

[Other Languages] 

Languages Focus

Case sensitiviy in this case is referring to commands and variable names. For example, are "printf" and "PrintF" equivalent? Are fullname and FullName equivalent? When you create commands, operations, methods, or variables should you worry about case?

C#:   Yes

In C# commands and variable names are case sensitive. The following does NOT:

messagebox.Show("hello");  //Does not compile!

The first time you type any other case for commands or variables, VS.Net will change it to the accepted or defined case. For example, if you type messagebox.show it is converted to MessageBox.Show. Once corrected, you can break it again by editing MessageBox to messagebox and the compiler will give you an error.

Syntax Example:

The following code works:

MessageBox.Show("hello");
JavaScript:   Yes

JavaScript is case sensitive. Change the case, and it no longer works! Notice the "W" in "Write" is capitalized.

<script language=JavaScript> 
<!--
document.Write("Hello"); //Does not work!
//-->
</script>

Variable names are case sensitive.

Syntax Example:

This does work:

<script language=JavaScript> 
<!--
document.write("Hello");
//-->
</script>












Go ahead!   Use Us! Call: 916-726-5675  Or visit our new sales site: 
www.prestwood.com


©1995-2024 Prestwood IT Solutions.   [Security & Privacy]