I keep getting this error in my app
small snippet of how simple this code is suppose to work
String lang = "Language.en-US".ToString();
appPath.Text = lang.Substring(2, lang.Length);//
Error
System.ArgumentOutOfRangeException:
Index and length must refer to a location within the string
i get an error each time i change the start index but if i set it to 0 it works but i can’t change the start index to a higher number than zero is there anything i can download like an update to fix this Im sure it my system thats wrong im using .Net 4.0.
You should change it to
Basically according to the Substring method documenation
startIndex + lengthshould be less than the string length.If you always want to get the string from second position to the very end you should use the overloaded version of Substring that is