Created
March 22, 2022 16:48
-
-
Save EdCharbeneau/43e397cf19234ffe1fa02d909c93f19e to your computer and use it in GitHub Desktop.
String Builder cleanup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class StringBuilderExtensions { | |
public static StringBuilder AppendWhen(this StringBuilder sb, string value, bool predicate) { | |
if(predicate) { | |
sb.Append(value); | |
} | |
return sb; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment