gg00xiv
Messages postés656Date d'inscriptionmercredi 22 août 2001StatutMembreDernière intervention11 mars 200513 23 sept. 2003 à 08:48
// Si je place dans une variable sArray.Length c pour ne pas effectuer un appel à Length à chaque itération. Un appel de propriété est comme un appel de fonction, c'est plus lent qu'un accès direct à une variable.
private int[] ConvertStringArrayToIntArray(string[] sArray)
{
int[] iArray = new int[sArray.Length];
int length = sArray.Length;
for (int i=0; i<length; i++)
iArray[i] = int.Parse(sArray[i]);
return iArray;
}
marchalf
Messages postés10Date d'inscriptionmercredi 18 décembre 2002StatutMembreDernière intervention17 juin 2005 12 janv. 2005 à 11:59
Ben moi j'utilise System.Convert.ToInt32(taChaineDeCaractère); et ça marche très bien. J'en avais besoin pour transformer les champs d'une dropdownlist en entier et c'est nickel!