Menu
CoddyTech

String

Part of the Fundamentals section of Coddy's C# journey. Lesson 7 of 70.

The string type is a special type that consists of multiple chars.

To initialize a string value in a variable, enclose it within double quotation marks:

string s1 = "This is a string";

In the above example, a string variable named s1 is initialized.

challenge icon

Challenge

Beginner

Store the string I am learning to code with Coddy! in a variable named coddy.

Be sure to store the exact string value with correct casing.

Try it yourself

        // Type your code below
        // Replace the empty text between the quotes with the string the task asks for
        string coddy = "";
quiz iconTest yourself

This lesson includes a short quiz. Start the lesson to answer it and track your progress.

All lessons in Fundamentals

Practice on your own: Online C# compiler