C# vs .NET: What is the Difference?

 
Written by Mark Pringle |
Published on:

C# is a structured object-oriented programming language used to create mobile apps, desktop apps, websites, enterprise software, games, and cloud-based services.

C# code might look like the code below. This is a method used to count the number of characters in a string:

    /// Return the number of characters in a string using. Sequential spaces are not counted.
    /// </summary>
    /// <param name="value">String you want to count chars in.</param>
    /// <returns>Number of chars in string.</returns>
    static int CountChars(string value)
    {
        int result = 0;
        bool lastWasSpace = false;

        foreach (char c in value)
        {
            if (char.IsWhiteSpace(c))
            {
                // A.
                // Only count sequential spaces one time.
                if (lastWasSpace == false)
                {
                    result++;
                }
                lastWasSpace = true;
            }
            else
            {
                // B.
                // Count other characters every time.
                result++;
                lastWasSpace = false;
            }
        }
        return result;
    }

.NET is a framework developed by Microsoft for building and running web applications on Windows. The .NET framework uses the C# programming language. However, it also uses other programming languages like Visual Basic (VB), C++, and F#. There have been many different programming languages used by .NET. C# is just one of the many languages.

In summary, C# is a programming language, while .NET is a framework.

For more information on .NET, see What is .NET Framework on Microsoft's website?

Copyright © TravelDailyLife.com 2025

Author: Mark Pringle
I'm just a guy who is addicted to the unfamiliar and who fulfills this addiction by traveling and writing about my travels. As a lover of sports, penning opinion articles related to sports is also a pastime.
My External Website (External Website Opens in New Window)

Comments

Please Login to Comment
No comments have been posted. Be the first.



Hire a Writer