Difference between String and string in C# Last Updated : 05 Apr, 2024 Summarize Comments Improve Suggest changes Share Like Article Like Report String is an alias for System.String class and instead of writing System.String one can use String which is a shorthand for System.String class and is defined in the .NET base class library. The size of the String object in memory is 2GB and this is an immutable object, we can not modify the characters in a string once declared, but we can delete it entirely Syntax: String variable = "my string";Example: C# // C# program to illustrate String using System; class GFG{ public static void Main() { // Declare String variable String a = "Welcome to GeeksforGeeks"; // Display the result Console.WriteLine(a); } } Output: Welcome to GeeksforGeeksA string is a sequence of Unicode characters from U+0000 to U+FFFF. Or we can say that a string represents the text. It is a keyword and it is immutable which means we can not modify the characters in a string once declared, but we can delete it entirely. We can create a string variable using the following syntax: Syntax: string variable = "my string";Example: C# // C# program to illustrate string using System; class GFG{ public static void Main() { // Declare string variable string a = "GeeksforGeeks"; // Display the result Console.WriteLine(a); } } OutputGeeksforGeeksDifference between String and string String string It is a class used to access string variables and formatting methods.It is a keyword used to create a string variableWe have to import String from the System.String module.There is no need to import any module for stringIt is a data typeIt is a keywordIt contains different types of methods, properties, etc.It is just an alias of the System.String Comment More infoAdvertise with us Next Article Difference between String and string in C# 171fa07058 Follow Improve Article Tags : Difference Between C# CSharp-string Similar Reads Difference between Array and String in Java An array is a collection of similar type of elements that are stored in a contiguous memory location. Arrays can contain primitives(int, char, etc) as well as object(non-primitives) references of a class depending upon the definition of the array. In the case of primitive data type, the actual value 5 min read Difference Between VB.NET and C# Visual Basic .NET is a high-level programming language that was initially developed in 1991. It was the first programming language that directly supported programming graphical user interfaces using language-supplied objects. It supports all the concepts of an object-oriented such as object, class, 2 min read What is the difference between 'String' and 'string' in TypeScript ? Unlike JavaScript, TypeScript uses static typing, i.e. it specifies what kind of data the variable will be able to hold. Since TypeScript is a superscript of JavaScript, it also holds a distinction between a string and String. The usage of a string object in JS (or TS for that matter) is very minima 4 min read Difference between String and Character array in Java Unlike C/C++ Character arrays and Strings are two different things in Java. Both Character Arrays and Strings are a collection of characters but are different in terms of properties. Differences between Strings and Character Arrays:PropertyStringCharacter ArrayDefinitionA sequence of characters is r 3 min read Difference Between C# and ASP.NET Pre-requisites: C#, ASP.NET C# (also known as C sharp) is an object-oriented programming language that is used to produce an array of applications for gaming, mobile, web, and Windows platforms also It is a modern and type-safe language and provides simple syntax which makes it easier to learn and i 2 min read Like