I’m having problems with the substring method, getting this error.
“Index and length must refer to a location within the string.”
“Parameter name: length”
string[] nombre = item.Split(new char[]{' '});
this.listBox5.Items.Add(nombre[0].Substring(0,2).ToUpper()+nombre[1].Substring(0,1));
It means that the values you are passing to
Substringare not valid for the string they are being called on. For example:As an aside, I see this a lot:
I think people are confused by the signature of the
Splitmethod. The following is sufficient: