static string MidStr(string Str, string sStart, string sEnd) {
return MidStr(Str, sStart, sEnd, 0);
}
static string MidStr(string Str, string sStart, string sEnd, int Start) {
if (!string.IsNullOrEmpty(Str)) {
int iStart = Str.IndexOf(sStart, Start);
if (iStart > -1) {
int sStartLength = sStart.Length;
if (string.IsNullOrEmpty(sEnd))
return Str.Substring(iStart + sStartLength);
else {
int iEnd = Str.IndexOf(sEnd, iStart + sStartLength);
if (iEnd > -1)
return Str.Substring(iStart + sStartLength, iEnd - iStart - sStartLength);
}
}
}
return string.Empty;
}