Cu toate ca ar fi tentant sa folosim aceasta metoda pentru a efectua o repetitie peste elementele Array, instructiunea for... in va returna numele proprietatilor definite de utilizator impreuna cu indexul numeric.
Arrays Although it may be tempting to use this as a way to iterate over Array elements, the for... in statement will return the name of your user-defined properties in addition to the numeric indexes.
Autres résultats
Acest lucru se întâmplă deoarece memoria pentru elementele array-ului nu este încă alocată.
This happens because the memory for the elements is not yet allocated.
Metoda AfiseazaBucle() iterează toate elementele array-ului și le imprimă pe consolă.
The method PrintLoops() iterates all elements of the array and prints them on the console.
Prin accesarea elementelor de array identificate printr-un index, putem atât citi cât și atribui o valoare, ceea ce înseamnă că elementele array-urilor pot fi tratate ca variabile.
By accessing the elements of arrays identified by an index, we can both read or assign a value, which means that the elements of the arrays can be treated as variables.
Array-ul inversat. Descriere Metoda reverse transpune elementele array-ului in ceea ce priveste pozitia, modificand array-ul, returnand o referinta la acel array.
Dacă vă amintiți lecția precedentă, am comparat un array cu o clădire, în care avem apartamente (elementele array-ului), fiecare fiind identificat printr-un număr de apartament (index, sau indice).
If you remember our previous lesson, we compared an array to a building, where we have apartments (array's elements), each identified by an apartment number (index, or indices).
Vă puteți imagina această matrice ca o clădire (array-ul în sine), cu 5 apartamente (elementele array-ului) identificate printr-un număr de apartament (indicele).
You can imagine this array as a building (the array itself), with 5 apartments (the array's elements) identified by an apartment number (the index).
Convertește toate elementele dintr-un array într-un alt tip.
It converts all elements in one array to another type.
Un alt mod de iterare prin elementele unui array este prin utilizarea buclei Foreach.
Another way of iteration through the elements of an array is by using a Foreach loop.
Dictionary<K, T>păstrează elementele într-un array intern și pune fiecare element la poziția calculată de funcția hash.
Dictionary<K, T>keeps internally the elements in an array and puts every element at the position calculated by the hash-function.
List<T>își păstrează elementele într-un array, care are o dimensiune mai mare decât numărul elementelor stocate.
List<T>holds its elements in an array, which has a bigger size than the count of the stored elements.
Din acest motiv, vă voi spune pur și simplu că o buclă Foreach a fost proiectată pentru a itera prin toate elementele unui array, liste sau orice altă colecție de elemente care implementează interfața IEnumerable.
For this reason, i will simply tell you that a Foreach loop was designed to iterate through all elements of an array, list or any other collection of elements that implement iEnumerable interface.
În cele din urmă, am folosit bucla Foreach pentru a trece prin toate elementele acestor array-uri și a afișa elementele la consola.
Finally, we used the foreach loop to cycle through all the elements of those arrays and display the elements on the console output.
Contenu potentiellement sensible ou inapproprié
Les exemples vous aident à traduire le mot ou l’expression cherchés dans des contextes variés. Ils ne sont ni sélectionnés ni validés par nous et peuvent contenir des mots ou des idées inappropriés. Signalez des exemples à modifier ou à retirer. Les traductions potentiellement sensibles, inappropriées ou familières sont généralement marquées de rouge ou d’orange.