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,25 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Intrinsics.X86;
using System.Text;
using System.Threading.Tasks;
namespace Stringaufgabe1
{
internal class CharString
{
private string? _string;
private int _index;
public int CountCharInString(string s, char c)
{
this._string = s;
this._index = _string.Split(c).Length -1;
return _index;
}
public void PrintInfo()
{
Console.WriteLine($"Vorkommende Anzahl: {this._index}");
}
}
}

13
Stringaufgabe1/Program.cs Normal file
View File

@@ -0,0 +1,13 @@
namespace Stringaufgabe1
{
internal class Program
{
static void Main(string[] args)
{
CharString charString = new CharString();
Console.WriteLine("Geben Sie ihren Text ein und dann nach dem buchstaben den Sie zählen wollen: ");
charString.CountCharInString(Console.ReadLine(),Convert.ToChar(Console.ReadLine()));
charString.PrintInfo();
}
}
}

View File

@@ -0,0 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>