77 writes to _firstChar
System.Private.CoreLib (77)
src\libraries\System.Private.CoreLib\src\System\String.Comparison.cs (7)
89
fixed (char* ap = &strA.
_firstChar
) fixed (char* bp = &strB.
_firstChar
)
605
return Unsafe.Add(ref
_firstChar
, (nint)localLength - 1) == value;
758
return Marvin.ComputeHash32(ref Unsafe.As<char, byte>(ref
_firstChar
), (uint)_stringLength * 2 /* in bytes, not chars */, (uint)seed, (uint)(seed >> 32));
769
return Marvin.ComputeHash32OrdinalIgnoreCase(ref
_firstChar
, _stringLength /* in chars, not bytes */, (uint)seed, (uint)(seed >> 32));
832
fixed (char* src = &
_firstChar
)
929
fixed (char* src = &
_firstChar
)
src\libraries\System.Private.CoreLib\src\System\String.cs (23)
85
destination: ref result.
_firstChar
,
111
destination: ref result.
_firstChar
,
137
destination: ref result.
_firstChar
,
171
destination: ref result.
_firstChar
,
300
SpanHelpers.Fill(ref result.
_firstChar
, (uint)count, c);
317
Buffer.Memmove(ref result.
_firstChar
, ref MemoryMarshal.GetReference(value), (uint)value.Length);
386
slice = new ReadOnlySpan<char>(ref Unsafe.Add(ref
_firstChar
, (nint)(uint)startIndex /* force zero-extension */), count);
405
destination: ref result.
_firstChar
,
406
source: ref str.
_firstChar
);
428
source: ref Unsafe.Add(ref
_firstChar
, sourceIndex),
440
Buffer.Memmove(ref destination._reference, ref
_firstChar
, (uint)Length);
457
Buffer.Memmove(ref destination._reference, ref
_firstChar
, (uint)Length);
473
source: ref
_firstChar
,
497
source: ref Unsafe.Add(ref
_firstChar
, startIndex),
525
public ref readonly char GetPinnableReference() => ref
_firstChar
;
527
internal ref char GetRawStringData() => ref
_firstChar
;
528
internal ref byte GetRawStringDataAsUInt8() => ref Unsafe.As<char, byte>(ref
_firstChar
);
529
internal ref ushort GetRawStringDataAsUInt16() => ref Unsafe.As<char, ushort>(ref
_firstChar
);
549
fixed (char* pTempChars = &s.
_firstChar
)
565
result.
_firstChar
= c;
572
result.
_firstChar
= c1;
573
Unsafe.Add(ref result.
_firstChar
, 1) = c2;
735
return Unsafe.Add(ref
_firstChar
, (nint)(uint)index /* force zero-extension */);
src\libraries\System.Private.CoreLib\src\System\String.Manipulation.cs (32)
63
destination: ref Unsafe.Add(ref dest.
_firstChar
, destPos),
64
source: ref src.
_firstChar
,
296
Span<char> resultSpan = new Span<char>(ref result.
_firstChar
, result.Length);
313
Span<char> resultSpan = new Span<char>(ref result.
_firstChar
, result.Length);
335
Span<char> resultSpan = new Span<char>(ref result.
_firstChar
, result.Length);
360
Span<char> resultSpan = new Span<char>(ref result.
_firstChar
, result.Length);
712
Buffer.Memmove(ref result.
_firstChar
, ref
_firstChar
, (nuint)startIndex);
713
Buffer.Memmove(ref Unsafe.Add(ref result.
_firstChar
, startIndex), ref value.
_firstChar
, (nuint)insertLength);
714
Buffer.Memmove(ref Unsafe.Add(ref result.
_firstChar
, startIndex + insertLength), ref Unsafe.Add(ref
_firstChar
, startIndex), (nuint)(oldLength - startIndex));
1101
ref char dest = ref Unsafe.Add(ref result.
_firstChar
, copiedLength);
1137
new Span<char>(ref result.
_firstChar
, count).Fill(paddingChar);
1138
Buffer.Memmove(ref Unsafe.Add(ref result.
_firstChar
, count), ref
_firstChar
, (nuint)oldLength);
1155
Buffer.Memmove(ref result.
_firstChar
, ref
_firstChar
, (nuint)oldLength);
1156
new Span<char>(ref Unsafe.Add(ref result.
_firstChar
, oldLength), count).Fill(paddingChar);
1176
Buffer.Memmove(ref result.
_firstChar
, ref
_firstChar
, (nuint)startIndex);
1177
Buffer.Memmove(ref Unsafe.Add(ref result.
_firstChar
, startIndex), ref Unsafe.Add(ref
_firstChar
, startIndex + count), (nuint)(newLength - startIndex));
1289
Buffer.Memmove(ref result.
_firstChar
, ref
_firstChar
, (uint)copyLength);
1357
int pos = PackedSpanHelpers.IndexOf(ref Unsafe.Add(ref
_firstChar
, i), c, Length - i);
1370
int pos = SpanHelpers.NonPackedIndexOfChar(ref Unsafe.Add(ref
_firstChar
, i), c, Length - i);
1386
int pos = SpanHelpers.IndexOf(ref Unsafe.Add(ref
_firstChar
, i), Length - i, ref oldValue.
_firstChar
, oldValue.Length);
1420
Span<char> dstSpan = new Span<char>(ref dst.
_firstChar
, dst.Length);
2288
destination: ref result.
_firstChar
,
2289
source: ref Unsafe.Add(ref
_firstChar
, (nint)(uint)startIndex /* force zero-extension */));
src\libraries\System.Private.CoreLib\src\System\String.Searching.cs (14)
23
ref
_firstChar
,
25
ref value.
_firstChar
,
37
=> SpanHelpers.ContainsValueType(ref Unsafe.As<char, short>(ref
_firstChar
), (short)value, Length);
48
public int IndexOf(char value) => SpanHelpers.IndexOfChar(ref
_firstChar
, value, Length);
79
? PackedSpanHelpers.IndexOfAnyIgnoreCase(ref
_firstChar
, valueLc, Length)
80
: SpanHelpers.IndexOfAnyChar(ref
_firstChar
, valueLc, valueUc, Length);
83
return SpanHelpers.IndexOfChar(ref
_firstChar
, value, Length);
98
int result = SpanHelpers.IndexOfChar(ref Unsafe.Add(ref
_firstChar
, startIndex), value, count);
113
return new ReadOnlySpan<char>(ref
_firstChar
, Length).IndexOfAny(anyOf);
138
int result = new ReadOnlySpan<char>(ref Unsafe.Add(ref
_firstChar
, startIndex), count).IndexOfAny(anyOf);
270
=> SpanHelpers.LastIndexOfValueType(ref Unsafe.As<char, short>(ref
_firstChar
), (short)value, Length);
295
int result = SpanHelpers.LastIndexOfValueType(ref Unsafe.As<char, short>(ref Unsafe.Add(ref
_firstChar
, startSearchAt)), (short)value, count);
312
return new ReadOnlySpan<char>(ref
_firstChar
, Length).LastIndexOfAny(anyOf);
343
int result = new ReadOnlySpan<char>(ref Unsafe.Add(ref
_firstChar
, startSearchAt), count).LastIndexOfAny(anyOf);
src\System\String.CoreCLR.cs (1)
69
fixed (char* pwzChar = &
_firstChar
)
16 references to _firstChar
System.Private.CoreLib (16)
src\libraries\System.Private.CoreLib\src\System\String.Comparison.cs (14)
83
Debug.Assert(strA.
_firstChar
== strB.
_firstChar
,
250
if (strA.
_firstChar
!= strB.
_firstChar
)
252
return strA.
_firstChar
- strB.
_firstChar
;
446
if (strA.
_firstChar
!= strB.
_firstChar
)
448
return strA.
_firstChar
- strB.
_firstChar
;
1134
if (this.Length < value.Length ||
_firstChar
!= value.
_firstChar
)
1179
return
_firstChar
== value;
1182
return Length != 0 &&
_firstChar
== value;
src\libraries\System.Private.CoreLib\src\System\String.Manipulation.cs (2)
2330
if (Length == 0 || (!char.IsWhiteSpace(
_firstChar
) && !char.IsWhiteSpace(this[^1])))
2340
if (Length == 0 || (
_firstChar
!= trimChar && this[^1] != trimChar))