emptyIf method
Return a empty String
if this equals comparisonString
. Otherwise return this.
Example
String t = 'OK'.emptyIf("OK"); // returns "";
String f = 'NO'.emptyIf("YES"); // returns "NO";
Implementation
String? emptyIf(String? comparisonString) =>
asIf((s) => s == comparisonString, "", this);