net CF
I need to use substring to capture the mid of a string.
txtpart.Text = "ab12345678cde";
string item = txtpart.Text.Substring(2,8);
Which the output should be 12345678.
But it always throws this Exception
System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Is there any function other than substring?
Your code looks fine.
Check this Blog from Daniel Moth about substring issue on .net cf
The Moth Substring Bug on .net cf
Best Regards