add Programmyday form github
This commit is contained in:
26
StringCountExtention/Program.cs
Normal file
26
StringCountExtention/Program.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace StringCountExtention
|
||||
{
|
||||
internal class Program
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
string input = "Hello World!";
|
||||
Console.WriteLine($"{input.LeftStringCount(5)}");
|
||||
Console.WriteLine($"{input.RightStringCount(6)}");
|
||||
}
|
||||
}
|
||||
static class StringCountExtention
|
||||
{
|
||||
public static string LeftStringCount(this string input, int frqen)
|
||||
{
|
||||
return input.Substring(0, frqen);
|
||||
}
|
||||
public static string RightStringCount(this string input, int frqen)
|
||||
{
|
||||
return input.Substring(frqen);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user