Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private string getFixedColor(string color) {
- char[] arr = color.ToCharArray ();
- bool flag = true;
- for (int i = 0; i < arr.Length; i++) {
- Debug.Log (arr [i]);
- if (arr [i] != arr [0])
- flag = false;
- }
- if (flag) {
- string res = color.ToCharArray()[0].ToString();
- return res;
- } else
- return new string (arr);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement