Menu
Coddy logo textTech

String

Part of the Fundamentals section of Coddy's C# journey — lesson 7 of 69.

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.

Cheat sheet

The string type consists of multiple characters. To initialize a string variable, enclose the value within double quotation marks:

string s1 = "This is a string";

Try it yourself

using System;

public class Program {
    public static void Main(string[] args) {
        // Type your code below
        string coddy = ?
        
        // Don't change the line below
        Console.WriteLine("coddy = " + coddy);
    }
}
quiz iconTest yourself

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

All lessons in Fundamentals