mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-10-04 02:52:21 -04:00
Document Colors.Strip and Colors.StripUsed
(why didn't this go through on the first commit???)
This commit is contained in:
parent
df0db25e23
commit
d29bf8245c
@ -245,6 +245,8 @@ namespace MCGalaxy {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary> Removes all instances of % or & and the character that follows.
|
||||||
|
/// Does *not* check if the character pair makes a real color </summary>
|
||||||
public static string Strip(string value) {
|
public static string Strip(string value) {
|
||||||
if (value.IndexOf('%') == -1 && value.IndexOf('&') == -1) return value;
|
if (value.IndexOf('%') == -1 && value.IndexOf('&') == -1) return value;
|
||||||
char[] output = new char[value.Length];
|
char[] output = new char[value.Length];
|
||||||
@ -261,6 +263,8 @@ namespace MCGalaxy {
|
|||||||
return new string(output, 0, usedChars);
|
return new string(output, 0, usedChars);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary> Removes all colors that are currently used.
|
||||||
|
/// This means % or & may be kept if they are not followed a used color code </summary>
|
||||||
public static string StripUsed(string message) {
|
public static string StripUsed(string message) {
|
||||||
if (message.IndexOf('%') == -1 && message.IndexOf('&') == -1) return message;
|
if (message.IndexOf('%') == -1 && message.IndexOf('&') == -1) return message;
|
||||||
char[] output = new char[message.Length];
|
char[] output = new char[message.Length];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user