Do char based extension for StartsWith and EndsWith make sense for ReadOnlySpan<char>
#85374
-
So this issue managed the addition of
but not the addition of
Am i missing something that would mean these methods dont make sense for |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 2 replies
-
There are already overloads for generic T: public static class MemoryExtensions
{
public static bool Contains<T>(this ReadOnlySpan<T> span, T value)
where T: IEquatable<T>;
} Note the |
Beta Was this translation helpful? Give feedback.
-
Probably because those can be simply implemented as If such methods were to be added, I'd argue they should be generic over |
Beta Was this translation helpful? Give feedback.
-
which one should be preferred:
or
or
? |
Beta Was this translation helpful? Give feedback.
-
I didn't realize this discussion existed already, but here's an API proposal issue for span |
Beta Was this translation helpful? Give feedback.
I didn't realize this discussion existed already, but here's an API proposal issue for span
StartsWith
/EndsWith
: #87689