I have a string like this. I need to take after first 8 character until first comma. I tried many things but i can’t figure it out? Could someone help? String comes like this.
"asTyped:fTestManager.Jobs.TestReplications.TestDataReplicationsJob,Version=1.0.0.0,"
I need convert this string to
"TestManager.Jobs.TestReplications.TestDataReplicationsJob"
I’ve tried
string tmp= "asTyped:fTestManager.Jobs.TestReplications.TestDataReplicationsJob,Version=1.0.0.0,";
int tmpLength = tmp.Substring(9).Length;
string test = tmp.Substring(tmp.IndexOf(',') - tmpLength)
I don’t know im trying somethings like this but i can’t make it out. Thank you all.
>Solution :
string str = "asTyped:fTestManager.Jobs.TestReplications.TestDataReplicationsJob,Version=1.0.0.0,";
string result = str.Split(',')[0].Substring(9);
first we split our string with , character with Split(char separator) method, then we get from index 9 to the end using Substring(int startIndex).