26 lines
596 B
C#
26 lines
596 B
C#
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}");
|
|
}
|
|
}
|
|
}
|