Initial commit
This commit is contained in:
commit
b087f272b4
26 changed files with 5345 additions and 0 deletions
53
Numbers/NumberString/DigitEnumerator.cs
Normal file
53
Numbers/NumberString/DigitEnumerator.cs
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
using System.Collections;
|
||||
|
||||
namespace Numbers.NumberString;
|
||||
|
||||
/// <summary>
|
||||
/// Allows to enumerate only the digits in a string
|
||||
/// </summary>
|
||||
/// <inheritdoc cref="IEnumerator{T}"/>
|
||||
public sealed class DigitEnumerator : IEnumerator<int>
|
||||
{
|
||||
// TODO
|
||||
// private readonly string _text;
|
||||
// private int _index;
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new instance of <see cref="DigitEnumerator"/> based on the given text.
|
||||
/// This will be called within <see cref="NumberString.GetEnumerator"/>.
|
||||
/// </summary>
|
||||
/// <param name="text">The text to iterate over (containing both letters and digits)</param>
|
||||
public DigitEnumerator(string text)
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
public bool MoveNext()
|
||||
{
|
||||
// TODO
|
||||
return false;
|
||||
}
|
||||
|
||||
public void Reset()
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
public int Current
|
||||
{
|
||||
get
|
||||
{
|
||||
// TODO
|
||||
return -1;
|
||||
|
||||
//static int GetDigit(char c) => c - '0';
|
||||
}
|
||||
}
|
||||
|
||||
object IEnumerator.Current => null!; // TODO
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
// TODO?
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue