22 lines
582 B
C#
22 lines
582 B
C#
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace ExtensionMethods
|
|
{
|
|
class Program
|
|
{
|
|
static void Main(string[] args)
|
|
{
|
|
string post = "This is supposed to be a very long blog post blah blah blah...";
|
|
var shortenedPost = post.Shorten(5);
|
|
|
|
IEnumerable<int> numbers = new List<int>() { 1, 3, 7 , 4 ,9,20,22};
|
|
var max = numbers.Max();
|
|
System.Console.WriteLine(max);
|
|
System.Console.WriteLine(shortenedPost);
|
|
}
|
|
}
|
|
}
|