add Programmyday form github

This commit is contained in:
Ruben Kallinich
2024-07-25 15:47:46 +02:00
parent 09c8eab938
commit 7362c3d7ce
132 changed files with 3669 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
using System.Runtime.CompilerServices;
using System.Security.Cryptography.X509Certificates;
namespace DoublingExtention
{
internal class Program
{
static void Main(string[] args)
{
string input = "Libelle";
Console.WriteLine(input.Doubling());
}
}
static class DublingExtention
{
public static string Doubling(this string input)
{
char previosChar = '\0'; //PreviosChar wird beim ersten druchlauf nicht geprüft.
char doubling;
for (int i = 0; i < input.Length; i++)
{
char currentChar = input[i];
if (i != 0)
{
previosChar = input[i - 1];
}
if (currentChar == previosChar)
{
doubling = currentChar;
return $"Folgende doppelte Buchstaben wurden gefunden: {doubling}";
}
}
return "Es wurden keine doppelten Buchstaben gefunden.";
}
}
}