selecting perticular strings from inside a string
Hi,
here my planning is to i have string with several values like
string abcd={a=1,b=2,c=3,......z=26}.
this is i have to select particular values like {j=10,l=12,q=17}.
so here is my code that will retrive data like above scenerio.
try
{
String sOrrData = e.Result.ToString();//assigning abcd string to this string.
string sOrr = "";
String[] sOrrValues ={"j","l","q" };
for (int i = 0; i < sOrrValues.Length; i++)
{
string sOrval = sOrrData.Substring(sOrrData.IndexOf(sOrrValues[i]), 100).ToString().Replace("\r\n", "$");
string[] sOrrSplit = sOrval.Split('$');
sOrr += sOrrSplit[0].ToString().ToUpper() + "\r\n";
}
tborrdata.Text = sOrr;
BusyIndicator4.IsBusy = false;
}
catch (Exception ex)
{
throw;
}
Comments