string s = "sw-100-133"; if (s.StartsWith("sw-100-")) { ... }
Regex myRegex = new Regex(@"sw\-\d\d\d[^\d].*"); if (myRegex.IsMatch((s)) { ... }
string input = "sw-100-133"; Match match1 = Regex.Match(input, @"sw-100-.*", RegexOptions.IgnoreCase); if (match1.Success) Console.WriteLine(match1.Value);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)