-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_utility_mp.gsc
More file actions
29 lines (26 loc) · 859 Bytes
/
_utility_mp.gsc
File metadata and controls
29 lines (26 loc) · 859 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/**
* Removes the color (^0 ^1 ^2 ^3 ^4 ^5 ^6 ^7 ^8 ^9) from a string.
* @param string The string from wich we want the colors removed.
* @return string An identical string without the color coding in it.
*/
removeColorFromString( string )
{
output = "";
for ( i = 0; i < string.size; i++ )
{
if ( string[i] == "^" )
{
if ( i < string.size - 1 )
{
if ( string[i + 1] == "0" || string[i + 1] == "1" || string[i + 1] == "2" || string[i + 1] == "3" || string[i + 1] == "4" ||
string[i + 1] == "5" || string[i + 1] == "6" || string[i + 1] == "7" || string[i + 1] == "8" || string[i + 1] == "9" )
{
i++;
continue;
}
}
}
output += string[i];
}
return output;
}