private string GetNewName(string name = "新建数据集") { if (DataCollections.Any(d => d.Name == name)) { char item = name.Last(); if (Char.IsDigit(item)) { int p = int.Parse(item.ToString()); name = name.Substring(name.Length - 2) + (p + 1); } else { name += '1'; } } return(name); }
private string GetNewName(string name = null) { if (name == null) { name = GlobalHelper.Get("key_239"); } if (DataCollections.Any(d => d.Name == name)) { var item = name.Last(); if (char.IsDigit(item)) { var p = int.Parse(item.ToString()); name = name.Substring(name.Length - 2) + (p + 1); } else { name += '1'; } } return(name); }