new ReverseChar(),
new IndexOfByte(),
new IndexOfChar(),
+ new IndexOfString(),
new SequenceEqualByte(),
new SequenceEqualChar(),
};
}
}
+ class IndexOfString : SpanMeasurement
+ {
+ public override string Name => "IndexOf strings";
+
+ string input = "string1";
+ string value = "string2";
+
+ public override void RunStep()
+ {
+ ReadOnlySpan<char> inputSpan = input.AsSpan();
+ ReadOnlySpan<char> valueSpan = value.AsSpan();
+
+ inputSpan.IndexOf(valueSpan, StringComparison.InvariantCulture);
+ }
+ }
+
abstract class SpanCharMeasurement : SpanMeasurement
{
protected char[] data;