repl.it
@kironroy/

extenstionmethods

C#

No description

fork
loading
Files
  • main.cs
  • main.exe
  • notes.txt
  • stringextenstions.cs
main.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;

namespace ExtensionMethods
{
    class Program
    {
        static void Main(string[] args)
        {
           string post = "These are the days of lasers in the jungle " +
                "Lasers in the jungle somewhere" +
                "Staccato signals of constant information" +
                "A loose affiliation of millionaires" +
                "And billionaires and baby";
            var shortenedPost = post.Shorten(9);

            Console.WriteLine(shortenedPost);

            IEnumerable<int> numbers = new List<int>() { 1, 5, 3, 10, 2, 18 };
            var max = numbers.Max();

            Console.WriteLine(max);

        }
    }
}