@@ -40,24 +40,24 @@ public static int IndexOf(this ReadOnlySpan<char> source, char search, StringCom
4040 }
4141
4242 /// <inheritdoc cref="string.IndexOf(char, int)"/>
43- public static int IndexOf ( this ReadOnlySpan < char > source , char search , int startIndex , StringComparison comparisonType )
43+ public static int IndexOf ( this ReadOnlySpan < char > source , char value , int startIndex , StringComparison comparisonType )
4444 {
4545 if ( startIndex >= source . Length )
4646 throw new ArgumentOutOfRangeException ( nameof ( startIndex ) , startIndex , "Must be less than the length of the source." ) ;
47- var i = source . Slice ( startIndex ) . IndexOf ( search , comparisonType ) ;
47+ var i = source . Slice ( startIndex ) . IndexOf ( value , comparisonType ) ;
4848 return i == - 1 ? - 1 : i + startIndex ;
4949 }
5050
5151 /// <inheritdoc cref="string.LastIndexOf(char)"/>
52- public static int LastIndexOf ( this ReadOnlySpan < char > source , char search , StringComparison comparisonType )
52+ public static int LastIndexOf ( this ReadOnlySpan < char > source , char value , StringComparison comparisonType )
5353 {
5454 Func < char , char > toUpper ;
5555 switch ( comparisonType )
5656 {
5757 case StringComparison . Ordinal :
5858 case StringComparison . CurrentCulture :
5959 case StringComparison . InvariantCulture :
60- return source . LastIndexOf ( search ) ;
60+ return source . LastIndexOf ( value ) ;
6161 case StringComparison . CurrentCultureIgnoreCase :
6262 toUpper = static c => char . ToUpper ( c , CultureInfo . CurrentCulture ) ;
6363 break ;
@@ -71,14 +71,14 @@ public static int LastIndexOf(this ReadOnlySpan<char> source, char search, Strin
7171 throw new ArgumentException ( "Invalid comparison type." , nameof ( comparisonType ) ) ;
7272 }
7373
74- var searchUpper = toUpper ( search ) ;
75- if ( searchUpper == search )
76- return source . LastIndexOf ( search ) ;
74+ var searchUpper = toUpper ( value ) ;
75+ if ( searchUpper == value )
76+ return source . LastIndexOf ( value ) ;
7777
7878 for ( var i = source . Length - 1 ; i >= 0 ; i -- )
7979 {
8080 var c = source [ i ] ;
81- if ( c == search ) return i ;
81+ if ( c == value ) return i ;
8282 if ( toUpper ( c ) == searchUpper )
8383 return i ;
8484 }
@@ -87,29 +87,29 @@ public static int LastIndexOf(this ReadOnlySpan<char> source, char search, Strin
8787 }
8888
8989 /// <inheritdoc cref="string.LastIndexOf(char)"/>
90- public static int LastIndexOf ( this string source , char search , StringComparison comparisonType )
91- => source . AsSpan ( ) . LastIndexOf ( search , comparisonType ) ;
90+ public static int LastIndexOf ( this string source , char value , StringComparison comparisonType )
91+ => source . AsSpan ( ) . LastIndexOf ( value , comparisonType ) ;
9292
9393 /// <inheritdoc cref="string.LastIndexOf(char)"/>
94- public static int LastIndexOf ( this StringSegment source , char search , StringComparison comparisonType )
95- => source . AsSpan ( ) . LastIndexOf ( search , comparisonType ) ;
94+ public static int LastIndexOf ( this StringSegment source , char value , StringComparison comparisonType )
95+ => source . AsSpan ( ) . LastIndexOf ( value , comparisonType ) ;
9696
9797 /// <inheritdoc cref="StringSegment.IndexOf(char)"/>
98- public static int IndexOf ( this StringSegment source , char search , StringComparison comparisonType )
99- => source . HasValue ? source . AsSpan ( ) . IndexOf ( search , comparisonType ) : - 1 ;
98+ public static int IndexOf ( this StringSegment source , char value , StringComparison comparisonType )
99+ => source . HasValue ? source . AsSpan ( ) . IndexOf ( value , comparisonType ) : - 1 ;
100100
101101 /// <inheritdoc cref="StringSegment.IndexOf(char)"/>
102- public static int IndexOf ( this StringSegment source , char search , int startIndex , StringComparison comparisonType )
103- => source . HasValue ? source . AsSpan ( ) . IndexOf ( search , startIndex , comparisonType ) : - 1 ;
102+ public static int IndexOf ( this StringSegment source , char value , int startIndex , StringComparison comparisonType )
103+ => source . HasValue ? source . AsSpan ( ) . IndexOf ( value , startIndex , comparisonType ) : - 1 ;
104104
105105#if NETSTANDARD2_0
106106 /// <inheritdoc cref="StringSegment.IndexOf(char)"/>
107- public static int IndexOf ( this string source , char search , StringComparison comparisonType )
108- => source . AsSpan ( ) . IndexOf ( search , comparisonType ) ;
107+ public static int IndexOf ( this string source , char value , StringComparison comparisonType )
108+ => source . AsSpan ( ) . IndexOf ( value , comparisonType ) ;
109109
110110 /// <inheritdoc cref="StringSegment.IndexOf(char)"/>
111- public static int LastIndexOf ( this string source , char search )
112- => source . AsSpan ( ) . LastIndexOf ( search ) ;
111+ public static int LastIndexOf ( this string source , char value )
112+ => source . AsSpan ( ) . LastIndexOf ( value ) ;
113113#endif
114114
115115 /// <summary>
0 commit comments