"The condition is unnecessary."
A call to Append(...)
method of a StringBuilder
object will be ignored if the parameter is null
or empty string
. Therefore it's unnecessary to add such logic in your code.
if (myString.HasValue())
myStringBuilder.Append(myString);
should be 🡻
myStringBuilder.Append(myString);