using System; namespace DemoConsole { class Program { static void Main(string[] args) { // 初始化字符串 string str = "a;b;c;d;e;f;g;"; if (string.IsNullOrEmpty(str)) { Console.WriteLine("字符串为空"); } else { Console.WriteLine("字符串不为空"); } Console.Read(); } } }