C#查找字符串中的所有子字符串

using System;

class Demo {
   static void Main() {

      string str = xyz;

      for (int i = 1; i < str.Length; i++) {
         for (int start = 0; start <= str.Length - i; start++) {
            string substr = str.Substring(start, i);
            Console.WriteLine(substr);
         }
      }
   }
}

相关文章

c#如何实现添加到列表代码:var list = new&...
c#循环访问字典代码:foreach(var item in m...
using System; namespace OperatorsAppl { class Program ...
using System; class Program { static void Main(string[...
using System; namespace OperatorsAppl { class Program {...
using System; namespace DeclaringConstants { class Pro...