可以使用正则表达式using System.Text.RegularExpressions;private static void PickString(string content){ //举个例子,挑出以abc为前缀的字符串,如“abcdfdsabcj”中可以提取出来"abcd”、"abcj" Regex regex = new Regex("abc[a-z]", RegexOptions.Compiled); MatchCollection matches = regex.Matches(content); foreach( Match match in matches) { Console.WriteLine(match.ToString()); }}