0

I've noticed this for a while now and am just curious if there is any advantage or benefit to "simplifying" the name.

Example:

var lst = new List<int> { 1, 2, 3, 4, 5 };
string commaLst = String.Join(",", lst);

ReSharper then says

Name can be simplified.

And suggests that I change String.Join() to string.Join()

Is one way better than the other in terms of performance or anything alike? What's the point of simplifying a name?

Quiver
  • 1,351
  • 6
  • 33
  • 56

1 Answers1

0

string is an alias of String in C#

In C#, string is an alias for the String class in .NET framework. In fact, every C# type has an equivalent in .NET. As another example, short and int in C# map to Int16 and Int32 in .NET. So, technically there is no difference between string and String, but it is common practice to declare a variable using C# keywords.

madoxdev
  • 3,770
  • 1
  • 24
  • 39