Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

all possible substrings of a string

public static  List<string> AllSubString(string str)
{
  var list = new List<string>();
  for (int i = 0; i < str.Length; i++)
  {
    for (int j = i; j <= str.Length; j++)
    {
      var sub = str.Substring(i, str.Length-i);
      list.Add(sub);
    }
  }
  return list;
}
Comment

All Possible SubString

public static List<string> SubString(String str)
{
  var list = new List<string>();
  for (int i = 0; i < str.Length; i++)
  {
    for (int j = 1; j <= str.Length - i; j++)
    {
      list.Add(str.Substring(i, j));
    }
  }
  return list;
}
Comment

PREVIOUS NEXT
Code Example
Csharp :: meaning of ??= in c# 
Csharp :: unity unfreeze position in script 
Csharp :: assembly project name c# .net 
Csharp :: if c# 
Csharp :: TimeZone in asp.net core 
Csharp :: c# funtion 
Csharp :: get both item and index in c# 
Csharp :: yield c# 
Csharp :: unity time scale 
Csharp :: yield in c# 
Csharp :: linked list reverse 
Csharp :: how to add to a list in c# 
Csharp :: c# string right extension 
Csharp :: c# normalize value 
Csharp :: list sum c# 
Csharp :: how to turn on/off Particle System unity 
Csharp :: reload usercontol wpf 
Csharp :: same click event diffrenet buttonms c# 
Csharp :: interface property implementation c# 
Csharp :: return stream from file c# 
Csharp :: c sharp 
Csharp :: convert list string to list enum c# 
Csharp :: vb.net datagridview set row index 
Csharp :: list of function in c# 
Csharp :: constructor in c# 
Csharp :: listview thread error 
Csharp :: int array to frequency dictionary c# 
Csharp :: unity inspector draw line 
Csharp :: link form to a button in dashbord visual c# 
Csharp :: int to char c# 
ADD CONTENT
Topic
Content
Source link
Name
7+5 =