sharp-chat/SharpChatCommon/StringDiff.cs

14 lines
455 B
C#
Raw Permalink Normal View History

namespace SharpChat;
public readonly struct StringDiff(
string before,
string? after,
StringComparison comparisonType = StringComparison.Ordinal
) : Diff {
public readonly string Before = before ?? throw new ArgumentNullException(nameof(before));
public readonly string After = after ?? before;
public readonly StringComparison ComparisonType = comparisonType;
public bool Changed => !Before.Equals(After, ComparisonType);
}