namespace System; internal static class StringExtensions { public static string ReplaceTypeSimple(this string typeSimple) { typeSimple = typeSimple .Replace("?", "") .Replace("", "") .Replace("", "") .Replace("", "") .Replace("", "") .Replace("IRemoteStreamContent", "Blob") .Replace("{string:string}", "Dictionary") .Replace("{number:string}", "Dictionary") .Replace("{string:number}", "Dictionary") .Replace("{string:object}", "Dictionary"); if (typeSimple.StartsWith("[") && typeSimple.EndsWith("]")) { typeSimple = typeSimple.ReplaceFirst("[", "").RemovePostFix("]", ""); typeSimple = typeSimple.Replace(typeSimple, $"{typeSimple}[]"); } return typeSimple; } public static string MiddleString(this string sourse, string startstr, string endstr) { var result = string.Empty; int startindex, endindex; startindex = sourse.IndexOf(startstr); if (startindex == -1) { return result; } var tmpstr = sourse.Substring(startindex + startstr.Length - 1); endindex = tmpstr.IndexOf(endstr); if (endindex == -1) { return result; } result = tmpstr.Remove(endindex + 1); return result; } }