Regex (edit)
string input = "[1,2,3,4,5,99]"; Regex regexObj = new Regex(@"(\d+)([^0-9]+)", RegexOptions.IgnorePatternWhitespace); Match match = regexObj.Match(input); while (match.Success) { Console.WriteLine(match.Groups[1].Value); match = match.NextMatch(); }
https://viblo.asia/p/tim-hieu-ve-xu-ly-chuoi-bang-regex-phan-cuoi-vyDZOQz75wj
https://viblo.asia/p/tim-hieu-ve-xu-ly-chuoi-bang-regex-phan-ii-YWOZrMYRKQ0