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
Work Days
a6
Encryption Practice
Need to convert datetime containg '/' to '-' format
30272 Program Ex3
Encapsulation and abstration
Linked List with basic functions.
Date Diff
sdfrgthyju8765rb dcd vxs dd
adxasxd