add Programmyday form github
This commit is contained in:
25
Stringaufgabe1/CharString.cs
Normal file
25
Stringaufgabe1/CharString.cs
Normal 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}");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user