79743456

Date: 2025-08-22 13:43:39
Score: 0.5
Natty:
Report link

This culd be usefui, if a string is null or it has spaces at the end;

Example:

string Test = "1, 2, 3, 4,  ";

Test = Test.TrimEnd(',');
//Result: "1, 2, 3, 4,  ";

Test = (Test ?? "").Trim().TrimEnd(',');
//Result: "1, 2, 3, 4";


Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: nandox