startIndex = k.IndexOf(" 43 ");
string test3 = k.Substring(startIndex, 32);
startIndex1 = k.IndexOf(" 54 ");
string test4 = k.Substring(startIndex, 55);
how to count no of characters between 2 indexes(startIndex and startIndex1) from a string in c#?
Count no of characters from string
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.

Roei BarRank #1,271 · 1.4K reputationPosted Sep 16, 2009, 11:40 PM EDT
int totalSize = index1 - index ;
if you want to remove the the Spaces
string _totalText = text2.Substring(index,index1);
int _totalSizeNoSpace = _totalText.Trim().Length;