- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What is the difference between String and string in C#?
String stands for System.String whereas string is an alias in C# for System.String −
For example
string str = "Welcome!";
It’s not essential, but generally String is used when you work with classes.
string str = String.Format("Welcome! {0}!", user);
Since the string is an alias for System. String. The alias for other datatypes are −
Example
object: System.Object string: System.String bool: System.Boolean float: System.Single double: System.Double decimal: System.Decimal byte: System.Byte sbyte: System.SByte short: System.Int16 ushort: System.UInt16 int: System.Int32 uint: System.UInt32 long: System.Int64 ulong: System.UInt64 char: System.Char
- Related Articles
- What is the difference between parseInt(string) and Number(string) in JavaScript?
- What is the difference between a mutable and immutable string in C#?
- What is the difference between a string and a byte string in Python?
- What is the difference between String s1 = "Hello" and String s1= new String("Hello") in java?
- What is the difference between a String object and a String literal in Java?
- Difference between String and StringBuilder in C#
- Difference between string and char[] types in C++
- What is the difference between character literals and string literals in Java?
- Difference between String buffer and String builder in Java
- Difference between strlen() and sizeof() for string in C
- Difference between C++ string constants and character constants
- Difference between String and StringBuffer.
- What is the difference between a String object and a StringBuffer object in java?
- What is the difference between String, StringBuffer and StringBuilder classes in Java explain briefly?
- Difference between Relational operator(==) and std::string::compare() in C++

Advertisements