Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
foreach
//Microsoft (R) Visual C# Compiler version 3.4.0-beta4-19562-05 (ff930dec) //Copyright (C) Microsoft Corporation. All rights reserved. using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { public class Program { public static void Main(string[] args) { string[] name = new string[5]; name[0] = "Alpha"; name[1] = "beta"; name[2] = "ceta"; name[3] = "delta"; name[4] = "etsilon"; for(int i = 0; i < name.Length; i++) { Console.WriteLine("posicion {0} {1}",i,name[i] ); } Console.WriteLine("==COMIENZA FOREACH=="); // enumera los elementos de una colección y ejecuta // su cuerpo para cada elemento de la colección foreach(var item in name)//var crea archivos que pueden contener otros archivos { //lo que tengamos en name lo copiamos en item, el bucle va a ser de acuerdo a la cantidad // de elementos del array name Console.WriteLine("item = {0}",item); } } } }
run
|
edit
|
history
|
help
0
see all properties of given ldap node
Listas JL
23
Switch on String
J
Collections
Find Highest,Lowest and average using two dimensional arrays
Write a program to count the occurrence of each distinct item in the array?
Puzz1
Knapsack Problem - recursive