What is the difference between String and string in C#?
Hello everyone. I just started learning C# and noticed that in different code examples strings are declared differently: sometimes via `String`, sometimes via `string`. For example:
```csharp
string name = "Alexey";
String lastName = "Ivanov";
```
I think it's the same thing, but I'm not sure. Maybe there is some subtle difference? Does it affect performance, memory, or the ability to use methods? I tried using `String` with a capital letter in Visual Studio, and the code compiled, but ReSharper highlighted it as a warning. Why?
I also heard that C# has keywords (like `int`, `bool`) and type aliases. `string` is a keyword, and `String` is a class from .NET? If so, why use `String` at all if `string` exists? Or is it a matter of style? I will be
No answers yet.
Log in to leave an answer