I want to find the position of a substring in a string if present without using any string method including indexof. I tried so much times but failed. Will anybody tell me h
Try this:
public static string BetweenOf(string ActualStr, string StrFirst, string StrLast) { return ActualStr.Substring(ActualStr.IndexOf(StrFirst) + StrFirst.Length, (ActualStr.Substring(ActualStr.IndexOf(StrFirst))).IndexOf(StrLast) + StrLast.Length); }