>>[I have not installed vs2010 on my new computer yet - so I cannot test]
>>
>>If you use a lot of mid() it will be slow. The reason is - I think - that each call creates another string (object)
>>
>>Can you use one char at a time ? If yes, why not index the string
>>
>>char c ;
>>string s = "very long string";
>>
>>c = s[5];
>>
>
>We are talking at thousands of MID() which have to be done in a flash. The string is also in the range of 20k. So, I am not sure if this would be any better. This is a highly complex algorythm. The best would be to have the StringBuilder to include a Mid() function. But, this is not supported yet.
Actually, there is
http://msdn.microsoft.com/en-us/library/fyx7s61s.aspxstring xx = sb.ToString(startIndex, length);
You can even make an extension method
But why do you need that many mid's ?
Gregory