string (C#)
A string in C# is a sequence of characters that represents text, written inside double quotes. Strings are immutable, meaning their contents can't be changed after they're created.
C#
You can join strings with + or, more cleanly, with string interpolation: $"Hello {name}". Useful members include .Length, .ToUpper(), .ToLower(), .Trim(), and .Replace().
string is an alias for the System.String type. Operations that look like they change a string actually return a new string.
Syntax
string text = "hello";Examples
C#
string greeting = "hello";
Console.WriteLine(greeting.ToUpper());
Console.WriteLine(greeting.Length);Output:
HELLO
5