Benefits of using string.Equals

 
When comparing two strings, we should not use .ToLower() and .ToUpper() ⚠️

ToLower() and ToUpper() create new string in the memory
 
Benefits of using string.Equals instead:
 
⏩ string comparison gives clear intent by specifying Ignore Case
 
⏩ It does not create new strings in memory, so they are performant than the ToLower/ToUpper

Post a Comment

0 Comments