Initial commit with a few examples

This commit is contained in:
2020-08-14 18:41:47 -04:00
commit aa0de90361
5 changed files with 133 additions and 0 deletions

27
Lists.cs Normal file
View File

@@ -0,0 +1,27 @@
//C#/Tutorials/HelloWorld.cs
//Matthew Ellison
// Created: 07-29-20
//Modified: 07-29-20
//This shows some basic list operations
using System;
namespace mee{
public class Lists{
public static Main(string[] args){
List<string> names = new List<string> { "Matthew", "Ana", "Felipe", "Maria", "Bill"};
names.Remove("Ana");
names.Add("Felipe");
foreach(string name in names){
Console.WriteLine($"{name}");
}
int location = names.IndexOf("Felipe");
Console.WriteLine($"location = {location}");
location = names.IndexOf("Bob");
Console.WriteLine($"location = {location}");
Console.WriteLine($"size = {names.Count}");
}
}
}