#csharp
#dotnet
#comparison
روش های بد مقایسه رشته ها در سی شارپ
تا به حال اکثرا از ToLowerیا ToUpper برای مقایسه رشته های غیر حساس به حروف بزرگ استفاده می کردیم .
اما این بهترین راه برای انجام آن نیست.
استفاده از string.Equals این مقایسه از سرعت عملکرد بهتری برخوردار است (در واقع به حروف کوچک یا بزرگ رشته ها علاقه ای نداریم).
همانطور که در تصویر می بینیم.
پس برای مقایسه دو رشته string بهتره از String.Equals استفاده کنیم
@fullStackDevs
#dotnet
#comparison
روش های بد مقایسه رشته ها در سی شارپ
تا به حال اکثرا از ToLowerیا ToUpper برای مقایسه رشته های غیر حساس به حروف بزرگ استفاده می کردیم .
اما این بهترین راه برای انجام آن نیست.
استفاده از string.Equals این مقایسه از سرعت عملکرد بهتری برخوردار است (در واقع به حروف کوچک یا بزرگ رشته ها علاقه ای نداریم).
همانطور که در تصویر می بینیم.
پس برای مقایسه دو رشته string بهتره از String.Equals استفاده کنیم
@fullStackDevs
👍11❤1
IMG_0165.JPG
2.2 MB
#csharp #visualstudio #csharp10 #aspdotnet #aspcore #dotnet
6 Amazing feature and improvement in C# 10:
📌 File-scoped namespace
📌 Record structs
📌 Constant interpolated strings
📌 Extended property patterns
📌 Global using directive
📌 Assignment and declaration in same deconstruction
❗️C# 10 is supported on .NET 6 .
@fullStackDevs
6 Amazing feature and improvement in C# 10:
📌 File-scoped namespace
📌 Record structs
📌 Constant interpolated strings
📌 Extended property patterns
📌 Global using directive
📌 Assignment and declaration in same deconstruction
❗️C# 10 is supported on .NET 6 .
@fullStackDevs
👍5
#dotnet
#CSharp10
In C# 10 With Expressions are not limited to records.
You can use them with anonymous types as well.
https://github.com/gsferreira/dotnet-playground
@fullStackDevs
#CSharp10
In C# 10 With Expressions are not limited to records.
You can use them with anonymous types as well.
https://github.com/gsferreira/dotnet-playground
@fullStackDevs
👍3