What is the difference between String and string in C# ? | Difference between String and string

Опубликовано: 31 Март 2021
на канале: ALLCPL
407
8

What is the difference between String and string in C#? | Difference between String and string

Answer:
1) There is no difference between String (capital S) and string in C#
2) String (capital S) is a class in the .NET framework in the System namespace.
3) The fully qualified name is System.String. Whereas, the lower case string is an alias of System.String
4) string is an alias in C# for System.String.
5) So technically, there is no difference. It's like int vs. System.Int32



Description :
As far as guidelines, it's generally recommended to use string any time you're referring to an object.

string place = “India”;

Likewise, I think it's generally recommended to use String if you need to refer specifically to the class.

string place = String.Format("Hello {0}!", place);

Conclusion:
Both are the same.The difference is how you use it.
string is for variables
String is for calling other String class methods


subscription :
difference between string and string in c#,difference between string and string,what is string and string in c#,how string is different from string,csharp string and string,string vs. system.string in c,string vs string,system.string vs string,c# course for beginners,string class in c#,c# step by step tutorial for beginners,csharp string introduction,dotnet and c# tutorial,string in c#.net,c# tutorial for beginners,string in c# tutorial

#interview #C-sharp-interview #c-sharp #String


На этой странице сайта вы можете посмотреть видео онлайн What is the difference between String and string in C# ? | Difference between String and string длительностью часов минут секунд в хорошем качестве, которое загрузил пользователь ALLCPL 31 Март 2021, поделитесь ссылкой с друзьями и знакомыми, на youtube это видео уже посмотрели 407 раз и оно понравилось 8 зрителям. Приятного просмотра!