Cette valeur j'aimerais la stocké dans un tableau .
// bug car la dimension depasse l'indice declaré.
> Olivier,
>
> (1) [HS] Si tu ne connais pas la longueur d'un string d'avance - passe
> par StringBuilder (regarde ma contrib)
> (2) Dans le cas ci-dessous, pourquoi ne pas utiliser un ArrayList
>
> static void doit()
> {
>
> var Olivier = new ArrayList();
> Olivier.Add("David1");
> Olivier.Add("David2");
> Olivier.Add("David3");
> Olivier.Add("David4");
> Olivier.Add("David5");
>
> Olivier.Add("Bobby");
>
> for( int i=0; i < Olivier.Count; i++ )
> Console.WriteLine(Olivier[i]);
>
> // si les dim ne changent plus
> String[] OlivierFinal =
> (string[])Olivier.ToArray(typeof(string));
> for (int i = 0; i < OlivierFinal.Length; i++)
> Console.WriteLine(OlivierFinal[i]);
> }
> "OlivierH" <"nospam[contact]"@planitron.com> wrote in message
> news:ft4mes$2hio$1@news.niouzes.net...
>> Regarde cette inconvenient pour le redimensionnement des tableaux
>>
>> // 5 is the size of the array
>> string[] names = new string[5];
>> names[0] = "David";
>> names[5] = "Bobby"; // Throws System.IndexOutOfRangeException
>>
>>
>> // C# can't dynamically resize an array. Just copy into new array.
>> string[] names2 = new string[7];
>> Array.Copy(names, names2, names.Length); // or names.CopyTo(names2, 0);
>>
>> En fox on avait pas ce probleme, grrr !!
>>
>>
>> Olivier QuiNeConnaitPasLeNombreDeLigneDeSonTableauAlavance
>>
>>
>>
>>
>>
>>
>>
>> Gregory a écrit :
>>> Olivier,
>>>
>>> Correct - je ne connais pas les dimensions - sauf si je me mets a
>>> compter les lignes qui suivent
>>> Les lignes qui suivent initalisent le tableau
>>>
>>> static string[,] VatNumberFormat =
>>> { { VATEXEMPT, null }, // Exempt
>>> #if IN_BELGIUM
>>> { " ","[01]\\d{9}" }, //
>>> #endif
>>> { "BE","[01]\\d{9}" }, // Belgium
>>> { "AT","U\\d{8}" }, // Austria
>>> { "BG","\\d{9,10}" }, // Bulgaria
>>> ........
>>>
>>> { "SK","\\d{9,10}" } // Slovac Rep
>>> };
>>>
>>> GregoryDimensioné
>>> __
>>> "OlivierH" <"nospam[contact]"@planitron.com> wrote in message
>>> news:ft4inq$2g0o$2@news.niouzes.net...
>>>> gregory,
>>>>
>>>> J'ai pas compris pourquoi tu as declaré le tableau de la facon
>>>> suivante,
>>>>
>>>> static string[,] VatNumberFormat;
>>>>
>>>> Est ce parce que tu connais pas les dimensions ?
>>>>
>>>> Olivier
>>>
>