From d29bf8245caaea9c9f6e923cce5b3fceca5fbe8d Mon Sep 17 00:00:00 2001 From: Goodlyay Date: Tue, 28 Apr 2020 00:21:24 -0700 Subject: [PATCH] Document Colors.Strip and Colors.StripUsed (why didn't this go through on the first commit???) --- MCGalaxy/Chat/Colors.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/MCGalaxy/Chat/Colors.cs b/MCGalaxy/Chat/Colors.cs index 62b5f0283..b61d1f783 100644 --- a/MCGalaxy/Chat/Colors.cs +++ b/MCGalaxy/Chat/Colors.cs @@ -245,6 +245,8 @@ namespace MCGalaxy { } } + /// Removes all instances of % or & and the character that follows. + /// Does *not* check if the character pair makes a real color public static string Strip(string value) { if (value.IndexOf('%') == -1 && value.IndexOf('&') == -1) return value; char[] output = new char[value.Length]; @@ -261,6 +263,8 @@ namespace MCGalaxy { return new string(output, 0, usedChars); } + /// Removes all colors that are currently used. + /// This means % or & may be kept if they are not followed a used color code public static string StripUsed(string message) { if (message.IndexOf('%') == -1 && message.IndexOf('&') == -1) return message; char[] output = new char[message.Length];