namespace TaikoWebUI.Utilities { public interface IStringUtil { List SplitIntoGroups(string str, int groupSize); } public class StringUtil : IStringUtil { public List SplitIntoGroups(string str, int groupSize) { List groups = new List(); for (int i = 0; i < str.Length; i += groupSize) { groups.Add(str.Substring(i, Math.Min(groupSize, str.Length - i))); } return groups; } public bool OnlyHexInString(string test) { return System.Text.RegularExpressions.Regex.IsMatch(test, @"\A\b[0-9a-fA-F]+\b\Z"); } } }