using System.Collections.Generic;
public static class Program
public static void Main()
const string test = "০০১. নাম: জাহাঙীর আলী ০০২. নাম: আফরাজুল ইসলাম ০০৩. নাম: িরয়াজুল ইসলাম ০০১. নাম: জাহাঙীর আলী ০০২. নাম: আফরাজুল ইসলাম ০০৩. নাম: িরয়াজুল ইসলাম";
List<int> i=test.AllIndexesOf("নাম:");
int k=test.Length-(test.Length-m+prvInd+6);
Console.WriteLine(test.Substring(prvInd,k));
public static List<int> AllIndexesOf(this string str, string value) {
if (String.IsNullOrEmpty(value))
throw new ArgumentException("the string to find may not be empty", "value");
List<int> indexes = new List<int>();
for (int index = 0;; index += value.Length) {
index = str.IndexOf(value, index);
public static string Between(this string value, string a, string b)
int posA = value.IndexOf(a);
int posB = value.LastIndexOf(b);
int adjustedPosA = posA + a.Length;
if (adjustedPosA >= posB)
return value.Substring(adjustedPosA, posB - adjustedPosA);