@@ -46,7 +46,7 @@ public ValueStringBuilder(Span<char> initialBuffer)
4646 /// </summary>
4747 /// <param name="initialText">The initial text used to initialize this instance.</param>
4848 [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
49- public ValueStringBuilder ( ReadOnlySpan < char > initialText )
49+ public ValueStringBuilder ( scoped ReadOnlySpan < char > initialText )
5050 {
5151 Append ( initialText ) ;
5252 }
@@ -122,7 +122,7 @@ public readonly ref char this[int index]
122122 /// <param name="fromString">The string as initial buffer.</param>
123123#pragma warning disable CA2225
124124 [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
125- public static implicit operator ValueStringBuilder( ReadOnlySpan < char > fromString ) => new ( fromString ) ;
125+ public static implicit operator ValueStringBuilder( scoped ReadOnlySpan < char > fromString ) => new ( fromString ) ;
126126#pragma warning restore CA2225
127127
128128 /// <summary>
@@ -263,7 +263,7 @@ public void Remove(int startIndex, int length)
263263 /// <param name="comparisonType">One of the enumeration values that specifies the rules for the search.</param>
264264 /// <returns>The index of the found <paramref name="word"/> in this string or -1 if not found.</returns>
265265 [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
266- public readonly int IndexOf ( ReadOnlySpan < char > word , StringComparison comparisonType = StringComparison . Ordinal ) => IndexOf ( word , 0 , comparisonType ) ;
266+ public readonly int IndexOf ( scoped ReadOnlySpan < char > word , StringComparison comparisonType = StringComparison . Ordinal ) => IndexOf ( word , 0 , comparisonType ) ;
267267
268268 /// <summary>
269269 /// Returns the index within this string of the first occurrence of the specified substring, starting at the specified index.
@@ -273,7 +273,7 @@ public void Remove(int startIndex, int length)
273273 /// <param name="comparisonType">One of the enumeration values that specifies the rules for the search.</param>
274274 /// <returns>The index of the found <paramref name="word"/> in this string or -1 if not found.</returns>
275275 [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
276- public readonly int IndexOf ( ReadOnlySpan < char > word , int startIndex , StringComparison comparisonType = StringComparison . Ordinal )
276+ public readonly int IndexOf ( scoped ReadOnlySpan < char > word , int startIndex , StringComparison comparisonType = StringComparison . Ordinal )
277277 {
278278 return buffer [ startIndex ..bufferPosition ] . IndexOf ( word , comparisonType ) ;
279279 }
@@ -285,7 +285,7 @@ public readonly int IndexOf(ReadOnlySpan<char> word, int startIndex, StringCompa
285285 /// <param name="comparisonType">One of the enumeration values that specifies the rules for the search.</param>
286286 /// <returns>The index of the found <paramref name="word"/> in this string or -1 if not found.</returns>
287287 [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
288- public readonly int LastIndexOf ( ReadOnlySpan < char > word , StringComparison comparisonType = StringComparison . Ordinal ) => LastIndexOf ( word , 0 , comparisonType ) ;
288+ public readonly int LastIndexOf ( scoped ReadOnlySpan < char > word , StringComparison comparisonType = StringComparison . Ordinal ) => LastIndexOf ( word , 0 , comparisonType ) ;
289289
290290 /// <summary>
291291 /// Returns the index within this string of the last occurrence of the specified substring, starting at the specified index.
@@ -295,7 +295,7 @@ public readonly int IndexOf(ReadOnlySpan<char> word, int startIndex, StringCompa
295295 /// <param name="comparisonType">One of the enumeration values that specifies the rules for the search.</param>
296296 /// <returns>The index of the found <paramref name="word"/> in this string or -1 if not found.</returns>
297297 [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
298- public readonly int LastIndexOf ( ReadOnlySpan < char > word , int startIndex , StringComparison comparisonType = StringComparison . Ordinal )
298+ public readonly int LastIndexOf ( scoped ReadOnlySpan < char > word , int startIndex , StringComparison comparisonType = StringComparison . Ordinal )
299299 {
300300 return buffer [ startIndex ..bufferPosition ] . LastIndexOf ( word , comparisonType ) ;
301301 }
@@ -310,15 +310,15 @@ public readonly int LastIndexOf(ReadOnlySpan<char> word, int startIndex, StringC
310310 /// This method performs an ordinal (case-sensitive and culture-insensitive) comparison.
311311 /// </remarks>
312312 [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
313- public readonly bool Contains ( ReadOnlySpan < char > word , StringComparison comparisonType = StringComparison . Ordinal ) => IndexOf ( word , comparisonType ) != - 1 ;
313+ public readonly bool Contains ( scoped ReadOnlySpan < char > word , StringComparison comparisonType = StringComparison . Ordinal ) => IndexOf ( word , comparisonType ) != - 1 ;
314314
315315 /// <summary>
316316 /// Returns whether the characters in this builder are equal to the characters in the given span.
317317 /// </summary>
318318 /// <param name="span">The character span to compare with the current instance.</param>
319319 /// <returns><see langword="true"/> if the characters are equal to this instance, otherwise <see langword="false"/>.</returns>
320320 [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
321- public readonly bool Equals ( ReadOnlySpan < char > span ) => span . Equals ( AsSpan ( ) , StringComparison . Ordinal ) ;
321+ public readonly bool Equals ( scoped ReadOnlySpan < char > span ) => span . Equals ( AsSpan ( ) , StringComparison . Ordinal ) ;
322322
323323 /// <summary>
324324 /// Returns whether the characters in this builder are equal to the characters in the given span according to the given comparison type.
@@ -327,7 +327,7 @@ public readonly int LastIndexOf(ReadOnlySpan<char> word, int startIndex, StringC
327327 /// <param name="comparisonType">The way to compare the sequences of characters.</param>
328328 /// <returns><see langword="true"/> if the characters are equal to this instance, otherwise <see langword="false"/>.</returns>
329329 [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
330- public readonly bool Equals ( ReadOnlySpan < char > span , StringComparison comparisonType ) => span . Equals ( AsSpan ( ) , comparisonType ) ;
330+ public readonly bool Equals ( scoped ReadOnlySpan < char > span , StringComparison comparisonType ) => span . Equals ( AsSpan ( ) , comparisonType ) ;
331331
332332 /// <summary>
333333 /// Disposes the instance and returns the rented buffer to the array pool if needed.
0 commit comments