New extender...
main programme:Code:public static string GetValue(this string thisString, String name) { name += ':'; int index1 = thisString.IndexOf(name); if (index1.Equals(-1)) return String.Empty; index1 += name.Length; int index2 = thisString.IndexOf(',', index1); if (index2.Equals(-1)) return thisString.Substring(index1); return thisString.Substring(index1, index2 - index1); }
Code:String a = "name:Trainwreck,Trainwreck:forum,xpos:12,ypos:67"; String b = a.GetValue("Trainwreck"); // b = "forum"




Reply With Quote