1439 references to Slice
aspire (27)
Commands\GroupedHelpWriter.cs (1)
251remaining = remaining[breakAt..].TrimStart();
Mcp\Docs\LlmsTxtParser.cs (18)
132var newlineIndex = span[position..].IndexOf('\n'); 140if (position < span.Length && IsH1Start(span[position..])) 237return trimmed[textStart..].Trim(); 260var lineEnd = content[lineStart..].IndexOf('\n'); 262? content[lineStart..(lineStart + lineEnd)] 263: content[lineStart..]; 274var nextNewline = content[position..].IndexOf('\n'); 322var sectionContent = docSpan[startIndex..endIndex].ToString(); 346var openIndex = content[position..].IndexOf("```"); 361var closeIndex = content[searchStart..].IndexOf("```"); 480var remaining = content[position..]; 489var trimmed = remaining[whitespaceSkipped..]; 511var headingSpan = trimmed[textStart..]; 526var afterHeading = content[absoluteEnd..]; 577var spaceIndex = span[position..].IndexOf(" #"); 602var span = content[startPosition..]; 608var bracketEnd = span[sectionMarker..].IndexOf(']'); 630var remaining = content[currentPosition..];
src\Shared\ConsoleLogs\AnsiParser.cs (8)
47if (IsConEmuSequence(span[currentPos..], ref currentPos) || 48IsControlSequence(span[currentPos..], ref currentPos, out _, out _) || 49IsLinkControlSequence(span[currentPos..], ref currentPos, out _)) 86if (IsConEmuSequence(span[i..], ref i)) 106if (IsLinkControlSequence(span[i..], ref i, out var url)) 129if (IsControlSequence(span[i..], ref i, out var finalByte, out var parameters)) 313span[currentParamStartPosition..i], 851var indexInSlice = span[startIndex..].IndexOf(value);
Aspire.Dashboard (10)
Model\GenAI\GenAIVisualizerDialogViewModel.cs (1)
470if (dotIndex > 0 && int.TryParse(remainder.Slice(0, dotIndex), out var messageIndex))
Otlp\Model\Serialization\OtlpJsonProtobufConverter.cs (1)
878bytes[i] = byte.Parse(hexSpan.Slice(i * 2, 2), System.Globalization.NumberStyles.HexNumber, System.Globalization.CultureInfo.InvariantCulture);
src\Shared\ConsoleLogs\AnsiParser.cs (8)
47if (IsConEmuSequence(span[currentPos..], ref currentPos) || 48IsControlSequence(span[currentPos..], ref currentPos, out _, out _) || 49IsLinkControlSequence(span[currentPos..], ref currentPos, out _)) 86if (IsConEmuSequence(span[i..], ref i)) 106if (IsLinkControlSequence(span[i..], ref i, out var url)) 129if (IsControlSequence(span[i..], ref i, out var finalByte, out var parameters)) 313span[currentParamStartPosition..i], 851var indexInSlice = span[startIndex..].IndexOf(value);
Aspire.Hosting.Docker (1)
EnvVarEscaper.cs (1)
72i += ProcessVariable(input[i..], result, depth + 1);
cdac-build-tool (2)
ObjectFileScraper.cs (2)
109public ReadOnlySpan<byte> GetBytes(long offset, int length) => Data.Span.Slice((int)offset, length); 345var nameBytes = nameStart.Slice(0, end);
dotnet (2)
_generated\187\RegexGenerator.g.cs (2)
214(charloop_ending_pos = inputSpan.Slice(charloop_starting_pos, Math.Min(inputSpan.Length, charloop_ending_pos + 3) - charloop_starting_pos).LastIndexOf(" in ")) < 0) 279(charloop_ending_pos1 = inputSpan.Slice(charloop_starting_pos1, Math.Min(inputSpan.Length, charloop_ending_pos1 + 5) - charloop_starting_pos1).LastIndexOf(":line ")) < 0)
GenerateDocumentationAndConfigFiles (5)
src\roslyn\src\Compilers\Core\Portable\Hashing\XxHashShared.cs (3)
275source.Slice(0, loadSize).CopyTo(new Span<byte>(buffer + state.BufferedCount, loadSize)); 314source.Slice(sourceIndex - StripeLengthBytes, StripeLengthBytes).CopyTo(new Span<byte>(buffer + InternalBufferLengthBytes - StripeLengthBytes, StripeLengthBytes)); 327source.Slice(sourceIndex - StripeLengthBytes, StripeLengthBytes).CopyTo(new Span<byte>(buffer + InternalBufferLengthBytes - StripeLengthBytes, StripeLengthBytes));
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\StringTable.cs (1)
509if (!chunk.Span.Equals(array.AsSpan().Slice(chunkOffset, chunk.Length), StringComparison.Ordinal))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\ObjectWriter.cs (1)
375span.Slice(offset, segmentLength).CopyTo(buffer.AsSpan());
ILAssembler (1)
GrammarVisitor.cs (1)
2576return Encoding.UTF8.GetString(bytes.Slice(bytesRead, length));
ILCompiler.Compiler (6)
Compiler\ObjectWriter\CodeView\CodeViewTypesBuilder.cs (1)
525_debugTypesBuilder._sectionWriter.Write(_bufferWriter.WrittenSpan.Slice(0, _lastListMemberStart));
Compiler\TypePreinit.cs (1)
3490((ReadOnlySpan<byte>)_value).Slice(startOffset, length)));
src\runtime\src\coreclr\tools\Common\Compiler\Dataflow\TypeExtensions.cs (1)
39return name.Slice(0, name.Length - metadataTypeName.Length - 1).Equals(metadataType.GetNamespace(), StringComparison.Ordinal);
src\runtime\src\coreclr\tools\Common\Compiler\NativeAotNameMangler.cs (2)
74sb.Append(s.Slice(0, i)); 108mangledName = new Utf8String(mangledName.AsSpan().Slice(0, 30).ToArray());
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\SectionData.cs (1)
145currentBuffer.Slice(0, buffer.Length).CopyTo(buffer);
ILCompiler.ReadyToRun (7)
IBC\IBCProfileParser.cs (2)
309ReadOnlySpan<byte> typeName = new ReadOnlySpan<byte>(typeEntry.Name).Slice(0, typeEntry.Name.Length - 1 /* these strings are null terminated */); 332typeNamespace = new ReadOnlySpan<byte>(namespaceEntry.Name).Slice(0, namespaceEntry.Name.Length - 1 /* these strings are null terminated */);
src\runtime\src\coreclr\tools\Common\Compiler\Dataflow\TypeExtensions.cs (1)
39return name.Slice(0, name.Length - metadataTypeName.Length - 1).Equals(metadataType.GetNamespace(), StringComparison.Ordinal);
src\runtime\src\coreclr\tools\Common\Compiler\NativeAotNameMangler.cs (2)
74sb.Append(s.Slice(0, i)); 108mangledName = new Utf8String(mangledName.AsSpan().Slice(0, 30).ToArray());
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\SectionData.cs (1)
145currentBuffer.Slice(0, buffer.Length).CopyTo(buffer);
src\runtime\src\coreclr\tools\Common\JitInterface\CorInfoImpl.cs (1)
4949rvaData.Slice(valueOffset, bufferSize).CopyTo(new Span<byte>(buffer, bufferSize));
ILCompiler.RyuJit (1)
src\runtime\src\coreclr\tools\Common\JitInterface\CorInfoImpl.cs (1)
4949rvaData.Slice(valueOffset, bufferSize).CopyTo(new Span<byte>(buffer, bufferSize));
illink (2)
ILLink.RoslynAnalyzer (6)
INamedTypeSymbolExtensions.cs (1)
29roSpan = roSpan.Slice(0, dot > 0 ? dot : 0);
src\runtime\src\libraries\System.Reflection.Metadata\src\System\Reflection\Metadata\TypeName.cs (3)
349name = name.Slice(0, _nestedNameLength); 395rootFullName = rootFullName.Slice(0, rootTypeName._nestedNameLength); 399rootTypeName._namespace = rootFullName.Slice(0, idx).ToString();
src\runtime\src\libraries\System.Reflection.Metadata\src\System\Reflection\Metadata\TypeNameParser.cs (1)
85ReadOnlySpan<char> fullTypeName = _inputString.Slice(0, fullTypeNameLength);
src\runtime\src\libraries\System.Reflection.Metadata\src\System\Reflection\Metadata\TypeNameParserHelpers.cs (1)
141return offset < 0 ? input : input.Slice(0, offset);
Microsoft.AspNetCore.Antiforgery (5)
Internal\DefaultAntiforgeryTokenSerializer.cs (4)
131tokenBytes = tokenBytes[securityTokenByteLength..]; 161tokenBytes = tokenBytes[claimUidByteLength..]; 167tokenBytes = tokenBytes[usernameLength..]; 173tokenBytes = tokenBytes[additionalDataLength..];
src\aspnetcore\src\Shared\Encoding\Int7BitEncodingUtils.cs (1)
157value = Encoding.UTF8.GetString(bytes.Slice(consumed, length));
Microsoft.AspNetCore.Components (4)
NavigationManager.cs (1)
356return uri[_baseUri.OriginalString.Length..];
src\aspnetcore\src\Http\Routing\src\Patterns\RoutePatternMatcher.cs (3)
381indexOfLiteral = requestSegment.Slice(0, startIndex).LastIndexOf( 388indexOfLiteral = requestSegment.Slice(0, startIndex).LastIndexOf( 462var parameterValueSpan = requestSegment.Slice(parameterStartIndex, parameterTextLength);
Microsoft.AspNetCore.Components.Endpoints (10)
FormMapping\PrefixResolver.cs (10)
59separatorX = x.Value.Span[currentXPos..].IndexOfAny('.', '['); 60separatorY = y.Value.Span[currentYPos..].IndexOfAny('.', '['); 66return MemoryExtensions.CompareTo(x.Value.Span[currentXPos..], y.Value.Span[currentYPos..], StringComparison.Ordinal); 71compare = MemoryExtensions.CompareTo(x.Value.Span[currentXPos..], y.Value.Span[currentYPos..][..separatorY], StringComparison.Ordinal); 81compare = MemoryExtensions.CompareTo(x.Value.Span[currentXPos..][..separatorX], y.Value.Span[currentYPos..], StringComparison.Ordinal); 89compare = MemoryExtensions.CompareTo(x.Value.Span[currentXPos..][..separatorX], y.Value.Span[currentYPos..][..separatorY], StringComparison.Ordinal);
Microsoft.AspNetCore.Components.Forms (1)
src\aspnetcore\src\Components\Shared\src\ExpressionFormatting\ReverseStringBuilder.cs (1)
77span[remainingLength..].CopyTo(_currentBuffer);
Microsoft.AspNetCore.Components.Server (6)
src\aspnetcore\src\submodules\MessagePack-CSharp\src\MessagePack.UnityClient\Assets\Scripts\MessagePack\BufferWriter.cs (1)
240source.Slice(copiedBytes, writable).CopyTo(_span);
src\aspnetcore\src\submodules\MessagePack-CSharp\src\MessagePack.UnityClient\Assets\Scripts\MessagePack\MessagePackReader.cs (3)
781span = this.reader.CurrentSpan.Slice(this.reader.CurrentSpanIndex, length); 817string value = StringEncoding.UTF8.GetString(unreadSpan.Slice(0, byteLength)); 1157initializedChars += decoder.GetChars(this.reader.UnreadSpan.Slice(0, bytesRead), charArray.AsSpan(initializedChars), flush);
src\aspnetcore\src\submodules\MessagePack-CSharp\src\MessagePack.UnityClient\Assets\Scripts\MessagePack\SequenceReader.cs (2)
459firstSpan.Slice(0, destination.Length).CopyTo(destination); 485nextSpan.Slice(0, toCopy).CopyTo(destination.Slice(copied));
Microsoft.AspNetCore.Components.Web (3)
Routing\NavLink.cs (2)
197return uri.Slice(0, minPos); 220currentUriAbsolute.SequenceEqual(hrefAbsolute.Slice(0, hrefAbsolute.Length - 1), CaseInsensitiveComparer))
src\aspnetcore\src\Components\Shared\src\ExpressionFormatting\ReverseStringBuilder.cs (1)
77span[remainingLength..].CopyTo(_currentBuffer);
Microsoft.AspNetCore.DataProtection (12)
KeyManagement\KeyRingBasedSpanDataProtector.cs (2)
101var magicHeaderFromPayload = BinaryPrimitives.ReadUInt32BigEndian(protectedData.Slice(0, sizeof(uint))); 103var keyIdFromPayload = new Guid(protectedData.Slice(sizeof(uint), sizeof(Guid)));
Managed\AesGcmAuthenticatedEncryptor.cs (4)
98var keyModifier = ciphertext.Slice(keyModifierOffset, KEY_MODIFIER_SIZE_IN_BYTES); 99var nonce = ciphertext.Slice(nonceOffset, NONCE_SIZE_IN_BYTES); 100var encrypted = ciphertext.Slice(encryptedDataOffset, plaintextBytes); 101var tag = ciphertext.Slice(tagOffset, TAG_SIZE_IN_BYTES);
Managed\ManagedAuthenticatedEncryptor.cs (5)
110var keyModifier = ciphertext.Slice(keyModifierOffset, KEY_MODIFIER_SIZE_IN_BYTES); 142var ivAndCiphertextSpan = ciphertext.Slice(ivOffset, macOffset - ivOffset); 143var providedMac = ciphertext.Slice(macOffset, _validationAlgorithmDigestLengthInBytes); 151var ciphertextSpan = ciphertext.Slice(ciphertextOffset, macOffset - ciphertextOffset); 152var iv = ciphertext.Slice(ivOffset, _symmetricAlgorithmBlockSizeInBytes);
src\aspnetcore\src\Shared\Encoding\Int7BitEncodingUtils.cs (1)
157value = Encoding.UTF8.GetString(bytes.Slice(consumed, length));
Microsoft.AspNetCore.Diagnostics.Middleware.PerformanceTests (4)
RedactionBenchmark.cs (4)
83segment = span.Slice(startIndex, i - startIndex); 146var segment = span.Slice(startIndex, i - startIndex).ToString(); 197segment = span.Slice(startIndex + 1, endIndex - startIndex); 277var segment = span.Slice(segments[i - 1], segments[i] - segments[i - 1] - 1);
Microsoft.AspNetCore.Http.Extensions (10)
src\aspnetcore\src\Components\Endpoints\src\FormMapping\PrefixResolver.cs (10)
59separatorX = x.Value.Span[currentXPos..].IndexOfAny('.', '['); 60separatorY = y.Value.Span[currentYPos..].IndexOfAny('.', '['); 66return MemoryExtensions.CompareTo(x.Value.Span[currentXPos..], y.Value.Span[currentYPos..], StringComparison.Ordinal); 71compare = MemoryExtensions.CompareTo(x.Value.Span[currentXPos..], y.Value.Span[currentYPos..][..separatorY], StringComparison.Ordinal); 81compare = MemoryExtensions.CompareTo(x.Value.Span[currentXPos..][..separatorX], y.Value.Span[currentYPos..], StringComparison.Ordinal); 89compare = MemoryExtensions.CompareTo(x.Value.Span[currentXPos..][..separatorX], y.Value.Span[currentYPos..][..separatorY], StringComparison.Ordinal);
Microsoft.AspNetCore.HttpLogging (3)
RequestBufferingStream.cs (2)
97if (span.Slice(0, innerCount).TryCopyTo(_tailMemory.Span)) 105BuffersExtensions.Write(this, span.Slice(0, innerCount));
ResponseBufferingStream.cs (1)
134var slice = span.Slice(0, innerCount);
Microsoft.AspNetCore.HttpOverrides (1)
IPNetwork.cs (1)
197if (!IPAddress.TryParse(networkSpan.Slice(0, forwardSlashIndex), out prefix))
Microsoft.AspNetCore.Localization (2)
CookieRequestCultureProvider.cs (2)
79var potentialCultureName = valueSpan[parts[0]]; 80var potentialUICultureName = valueSpan[parts[1]];
Microsoft.AspNetCore.Mvc.ViewFeatures (1)
Rendering\TagBuilder.cs (1)
191stringBuffer.Append(remainingName.Slice(0, indexOfInvalidCharacter));
Microsoft.AspNetCore.OpenApi (1)
Services\Schemas\OpenApiSchemaService.cs (1)
688: currentPathWithoutSlash.Slice(0, indexOfNextPath);
Microsoft.AspNetCore.OutputCaching (2)
FormatterBinaryWriter.cs (1)
201value.Slice(start: 0, length: toWrite).CopyTo(available);
RecyclableSequenceBuilder.cs (1)
105buffer.Slice(0, toWrite).CopyTo(available);
Microsoft.AspNetCore.Razor.Utilities.Shared (3)
Utilities\Hashing\XxHashShared.cs (3)
274source.Slice(0, loadSize).CopyTo(new Span<byte>(buffer + state.BufferedCount, loadSize)); 313source.Slice(sourceIndex - StripeLengthBytes, StripeLengthBytes).CopyTo(new Span<byte>(buffer + InternalBufferLengthBytes - StripeLengthBytes, StripeLengthBytes)); 326source.Slice(sourceIndex - StripeLengthBytes, StripeLengthBytes).CopyTo(new Span<byte>(buffer + InternalBufferLengthBytes - StripeLengthBytes, StripeLengthBytes));
Microsoft.AspNetCore.ResponseCaching (1)
src\aspnetcore\src\Shared\SegmentWriteStream.cs (1)
146buffer = buffer[bytesWritten..];
Microsoft.AspNetCore.Rewrite (3)
ApacheModRewrite\FlagParser.cs (3)
77if (!_ruleFlagLookup.TryGetValue(tokenSpan[hasPayload[0]].ToString(), out flag)) 79throw new FormatException($"Unrecognized flag: '{tokenSpan[hasPayload[0]]}'"); 84flags.SetFlag(flag, tokenSpan[hasPayload[1]].ToString());
Microsoft.AspNetCore.Routing (11)
Matching\HostMatcherPolicy.cs (8)
102host = host.Slice(0, pivot); 171if (!hostSpan[hostParts[0]].IsEmpty) 173return new EdgeKey(hostSpan[hostParts[0]].ToString(), null); 178if (!hostSpan[hostParts[0]].IsEmpty) 180if (int.TryParse(hostSpan[hostParts[1]], out var port)) 182return new EdgeKey(hostSpan[hostParts[0]].ToString(), port); 184else if (hostSpan[hostParts[1]].Equals(WildcardHost, StringComparison.Ordinal)) 186return new EdgeKey(hostSpan[hostParts[0]].ToString(), null);
Patterns\RoutePatternMatcher.cs (3)
381indexOfLiteral = requestSegment.Slice(0, startIndex).LastIndexOf( 388indexOfLiteral = requestSegment.Slice(0, startIndex).LastIndexOf( 462var parameterValueSpan = requestSegment.Slice(parameterStartIndex, parameterTextLength);
Microsoft.AspNetCore.Server.HttpSys (3)
_generated\6\Windows.Win32.char.InlineArrays.g.cs (1)
65 internal readonly string ToString(int length) => AsReadOnlySpan().Slice(0, length).ToString();
_generated\70\Windows.Win32.InlineArrayIndexerExtensions.g.cs (1)
26 return length < 0 ? value : value.Slice(0, length);
src\aspnetcore\src\Shared\HttpSys\RequestProcessing\NativeRequestContext.cs (1)
113ref Unsafe.As<byte, long>(ref MemoryMarshal.GetReference(timingInfo.Span[sizeof(long)..])),
Microsoft.AspNetCore.Server.IIS (4)
_generated\37\Windows.Win32.InlineArrayIndexerExtensions.g.cs (1)
26 return length < 0 ? value : value.Slice(0, length);
_generated\5\Windows.Win32.char.InlineArrays.g.cs (1)
65 internal readonly string ToString(int length) => AsReadOnlySpan().Slice(0, length).ToString();
src\aspnetcore\src\Shared\HttpSys\RequestProcessing\NativeRequestContext.cs (1)
113ref Unsafe.As<byte, long>(ref MemoryMarshal.GetReference(timingInfo.Span[sizeof(long)..])),
src\aspnetcore\src\Shared\ServerInfrastructure\BufferWriter.cs (1)
146source.Slice(0, writable).CopyTo(_span);
Microsoft.AspNetCore.Server.Kestrel.Core (20)
Internal\Http\Http1Connection.cs (1)
1088var clientPrefaceRequestLine = Http2.Http2Connection.ClientPreface.Slice(0, PrefaceLineLength);
Internal\Http\HttpHeaders.Generated.cs (2)
14818output.Write(HeaderBytes.Slice(640, 18)); 15174var headerKey = HeaderBytes.Slice(keyStart, keyLength);
Internal\Http\HttpParser.cs (5)
349handler.OnHeader(name: headerLine.Slice(0, nameEnd), value: headerLine[valueStart..valueEnd]); 625span = span.Slice(0, crIndex); 630span = span.Slice(0, span.Length - 1); 678span = span.Slice(0, lfIndex);
Internal\Http2\Http2Connection.cs (1)
647httpVersion = HttpUtilities.GetKnownVersion(requestLine.Slice(requestLine.Length - 9, 8));
src\aspnetcore\src\Shared\runtime\Http2\Hpack\HPackDecoder.cs (5)
198ReadOnlySpan<byte> headerBytes = data.Slice(_headerNameRange.GetValueOrDefault().start, _headerNameRange.GetValueOrDefault().length); 448data.Slice(currentIndex, count).CopyTo(_stringOctets.AsSpan(_stringIndex)); 479data.Slice(currentIndex, count).CopyTo(_stringOctets.AsSpan(_stringIndex)); 508: data.Slice(_headerValueRange.GetValueOrDefault().start, _headerValueRange.GetValueOrDefault().length); 523: data.Slice(_headerNameRange.GetValueOrDefault().start, _headerNameRange.GetValueOrDefault().length);
src\aspnetcore\src\Shared\runtime\Http3\QPack\QPackDecoder.cs (5)
249ReadOnlySpan<byte> headerBytes = data.Slice(_headerNameRange.GetValueOrDefault().start, _headerNameRange.GetValueOrDefault().length); 310data.Slice(currentIndex, count).CopyTo(_stringOctets.AsSpan(_stringIndex)); 394data.Slice(currentIndex, count).CopyTo(_stringOctets.AsSpan(_stringIndex)); 595: data.Slice(_headerValueRange.GetValueOrDefault().start, _headerValueRange.GetValueOrDefault().length); 605: data.Slice(_headerNameRange.GetValueOrDefault().start, _headerNameRange.GetValueOrDefault().length);
src\aspnetcore\src\Shared\ServerInfrastructure\BufferWriter.cs (1)
146source.Slice(0, writable).CopyTo(_span);
Microsoft.AspNetCore.Watch.BrowserRefresh (2)
src\sdk\src\Dotnet.Watch\Web.Middleware\ScriptInjectingStream.cs (2)
210var remainingBodyTagBytes = s_bodyTagBytes.Span[currentBodyTagLength..]; 338=> new(Span.Slice(start, length), offsetFromOriginal: _offsetFromOriginal + start);
Microsoft.AspNetCore.WebUtilities (4)
FormPipeReader.cs (2)
174keyValuePair = span.Slice(0, ampersand); 213key = keyValuePair.Slice(0, equals);
HttpResponseStreamWriter.cs (1)
662var source = value.Slice(0, remaining);
QueryHelpers.cs (1)
90uriToBeAppended = uriToBeAppended.Slice(0, anchorIndex);
Microsoft.Build (23)
_generated\0\RegexGenerator.g.cs (7)
1856(charloop_ending_pos1 = inputSpan.Slice(charloop_starting_pos1, charloop_ending_pos1 - charloop_starting_pos1).LastIndexOf(':')) < 0) 2234(charloop_ending_pos = inputSpan.Slice(charloop_starting_pos, charloop_ending_pos - charloop_starting_pos).LastIndexOf('(')) < 0) 5909(charloop_ending_pos = inputSpan.Slice(charloop_starting_pos, Math.Min(inputSpan.Length, charloop_ending_pos + 1) - charloop_starting_pos).LastIndexOf("?>")) < 0) 6106(charloop_ending_pos = inputSpan.Slice(charloop_starting_pos, Math.Min(inputSpan.Length, charloop_ending_pos + 1) - charloop_starting_pos).LastIndexOf("\")")) < 0) 6202(charloop_ending_pos1 = inputSpan.Slice(charloop_starting_pos1, charloop_ending_pos1 - charloop_starting_pos1).LastIndexOf('"')) < 0) 6297(charloop_ending_pos2 = inputSpan.Slice(charloop_starting_pos2, charloop_ending_pos2 - charloop_starting_pos2).LastIndexOf('"')) < 0) 6392(charloop_ending_pos3 = inputSpan.Slice(charloop_starting_pos3, charloop_ending_pos3 - charloop_starting_pos3).LastIndexOf('"')) < 0)
BackEnd\Components\Logging\BuildErrorTelemetryTracker.cs (1)
278ReadOnlySpan<char> digits = codeSpan.Slice(3, 4);
BuildCheck\Checks\ExecCliBuildCheck.cs (3)
74var nextSeparatorIndex = commandSpan.Slice(start, commandSpan.Length - start).IndexOfAny(s_knownCommandSeparators); 92var command = commandSpan.Slice(start, nextSeparatorIndex); 148: knownBuildCommand.AsSpan().Slice(0, nextSpaceIndex).ToString();
Evaluation\ConditionEvaluator.cs (2)
116ContainsInvalidCharacter(input.Slice(beginning + 2, length - 3))) 122propertyName = input.Slice(beginning + 2, length - 3);
Evaluation\Expander.Function.cs (5)
227expressionRoot = expressionRoot.Slice(0, argumentStartIndex); 248var typeName = Strings.WeakIntern(expressionRoot.Slice(1, typeEndIndex - 1)); 306var functionReceiver = Strings.WeakIntern(expressionRoot.Slice(0, rootEndIndex).Trim()); 904ReadOnlySpan<char> expressionSubstringAsSpan = argumentStartIndex > -1 ? expressionFunctionAsSpan.Slice(methodStartIndex, argumentStartIndex - methodStartIndex) : ReadOnlySpan<char>.Empty; 970ReadOnlySpan<char> netPropertyName = expressionFunctionAsSpan.Slice(methodStartIndex, methodLength).Trim();
Logging\OptimizedStringIndenter.cs (1)
82input.Slice(segment.Start, segment.Length).CopyTo(output);
Logging\TerminalLogger\Terminal.cs (1)
173ReadOnlySpan<char> truncatedText = text.Slice(0, Math.Min(text.Length, Width - 1));
Logging\TerminalLogger\TerminalLogger.cs (1)
1809sb.Append(text.AsSpan().Slice(start, length));
Utilities\SimpleVersion.cs (2)
143span = span.Slice(0, separatorIndex); 159value = ParseComponent(span.Slice(0, dotIndex));
Microsoft.Build.Framework (5)
EscapingUtilities.cs (1)
245source.Slice(sourceIndex, charsToCopy).CopyTo(destination);
FileUtilities.cs (2)
668ReadOnlySpan<char> segment = sep < 0 ? path : path.Slice(0, sep); 851ReadOnlySpan<char> directory = value.Slice(0, directoryLength);
Utilities\FileMatcher.cs (1)
1740return MemoryExtensions.Equals(input.Slice(iIndex, 1), pattern.AsSpan(pIndex, 1), StringComparison.OrdinalIgnoreCase);
Utilities\ProcessExtensions.cs (1)
173ReadOnlySpan<byte> segment = nullIndex >= 0 ? data.Slice(0, nullIndex) : data;
Microsoft.Build.Tasks.Core (3)
_generated\0\RegexGenerator.g.cs (3)
1474(charloop_ending_pos1 = inputSpan.Slice(charloop_starting_pos1, charloop_ending_pos1 - charloop_starting_pos1).LastIndexOf(':')) < 0) 1852(charloop_ending_pos = inputSpan.Slice(charloop_starting_pos, charloop_ending_pos - charloop_starting_pos).LastIndexOf('(')) < 0) 3945ReadOnlySpan<char> repeaterSlice = slice.Slice(0, 16);
Microsoft.Build.Utilities.Core (2)
_generated\0\RegexGenerator.g.cs (2)
1315(charloop_ending_pos1 = inputSpan.Slice(charloop_starting_pos1, charloop_ending_pos1 - charloop_starting_pos1).LastIndexOf(':')) < 0) 1693(charloop_ending_pos = inputSpan.Slice(charloop_starting_pos, charloop_ending_pos - charloop_starting_pos).LastIndexOf('(')) < 0)
Microsoft.CodeAnalysis (7)
Hashing\XxHashShared.cs (3)
275source.Slice(0, loadSize).CopyTo(new Span<byte>(buffer + state.BufferedCount, loadSize)); 314source.Slice(sourceIndex - StripeLengthBytes, StripeLengthBytes).CopyTo(new Span<byte>(buffer + InternalBufferLengthBytes - StripeLengthBytes, StripeLengthBytes)); 327source.Slice(sourceIndex - StripeLengthBytes, StripeLengthBytes).CopyTo(new Span<byte>(buffer + InternalBufferLengthBytes - StripeLengthBytes, StripeLengthBytes));
InternalUtilities\LittleEndianReader.cs (1)
46var result = _span.Slice(0, byteCount);
InternalUtilities\StringTable.cs (1)
509if (!chunk.Span.Equals(array.AsSpan().Slice(chunkOffset, chunk.Length), StringComparison.Ordinal))
MetadataReader\MetadataHelpers.cs (1)
532if (tryScanArity(emittedTypeName[indexOfManglingChar..]) is not short arity)
Syntax\SyntaxTriviaListBuilder.cs (1)
101items.Slice(offset, length).CopyTo(_nodes.AsSpan().Slice(_count, length));
Microsoft.CodeAnalysis.Analyzers (4)
src\roslyn\src\Compilers\Core\Portable\Hashing\XxHashShared.cs (3)
275source.Slice(0, loadSize).CopyTo(new Span<byte>(buffer + state.BufferedCount, loadSize)); 314source.Slice(sourceIndex - StripeLengthBytes, StripeLengthBytes).CopyTo(new Span<byte>(buffer + InternalBufferLengthBytes - StripeLengthBytes, StripeLengthBytes)); 327source.Slice(sourceIndex - StripeLengthBytes, StripeLengthBytes).CopyTo(new Span<byte>(buffer + InternalBufferLengthBytes - StripeLengthBytes, StripeLengthBytes));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\ObjectWriter.cs (1)
375span.Slice(offset, segmentLength).CopyTo(buffer.AsSpan());
Microsoft.CodeAnalysis.AnalyzerUtilities (4)
src\roslyn\src\Compilers\Core\Portable\Hashing\XxHashShared.cs (3)
275source.Slice(0, loadSize).CopyTo(new Span<byte>(buffer + state.BufferedCount, loadSize)); 314source.Slice(sourceIndex - StripeLengthBytes, StripeLengthBytes).CopyTo(new Span<byte>(buffer + InternalBufferLengthBytes - StripeLengthBytes, StripeLengthBytes)); 327source.Slice(sourceIndex - StripeLengthBytes, StripeLengthBytes).CopyTo(new Span<byte>(buffer + InternalBufferLengthBytes - StripeLengthBytes, StripeLengthBytes));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\ObjectWriter.cs (1)
375span.Slice(offset, segmentLength).CopyTo(buffer.AsSpan());
Microsoft.CodeAnalysis.CodeStyle (4)
src\roslyn\src\Compilers\Core\Portable\Hashing\XxHashShared.cs (3)
275source.Slice(0, loadSize).CopyTo(new Span<byte>(buffer + state.BufferedCount, loadSize)); 314source.Slice(sourceIndex - StripeLengthBytes, StripeLengthBytes).CopyTo(new Span<byte>(buffer + InternalBufferLengthBytes - StripeLengthBytes, StripeLengthBytes)); 327source.Slice(sourceIndex - StripeLengthBytes, StripeLengthBytes).CopyTo(new Span<byte>(buffer + InternalBufferLengthBytes - StripeLengthBytes, StripeLengthBytes));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\ObjectWriter.cs (1)
375span.Slice(offset, segmentLength).CopyTo(buffer.AsSpan());
Microsoft.CodeAnalysis.CSharp (7)
CSharpParseOptions.cs (1)
224singleNamespaceBuilder.Add(@namespace.Slice(currentIndex, dotIndex - currentIndex).ToString());
Parser\LanguageParser_InterpolatedString.cs (6)
206originalTextSpan[currentContentStart..interpolation.OpenBraceRange.Start])); 223originalTextSpan[currentContentStart..closeQuoteRange.Start])); 236var closeQuoteText = originalTextSpan[closeQuoteRange]; 245return closeQuoteText[afterNewLine..afterWhitespace]; 291var currentLineWhitespace = text[lineStartPosition..currentIndex]; 473var slice = text[start..currentIndex];
Microsoft.CodeAnalysis.CSharp.Workspaces (1)
Classification\Worker_Preprocesser.cs (1)
394var separatorIndex = contentText[nameStart..].IndexOf(separator);
Microsoft.CodeAnalysis.Features (1)
MetadataAsSource\AbstractMetadataAsSourceService.DocCommentFormatter.cs (1)
199foreach (var c in span.Slice(0, end))
Microsoft.CodeAnalysis.Razor.Compiler (12)
CSharp\RequiredAttributeParser.cs (3)
196_span = _span[nameEndIndex..]; 243_span = _span[valueEndIndex..]; 319_span = _span[nameEndIndex..];
Language\CodeGeneration\CodeWriter.cs (3)
282span = span[newLineIndex..]; 436source = source[charIndex..]; 520source = source[charIndex..];
Language\NamespaceComputer.cs (1)
52var suffix = sourceFilePath[directiveDirectorySpan.Length..];
Language\RazorProjectEngineBuilderExtensions.cs (1)
29configurationName = configurationName[s_prefix.Length..];
Language\StringTokenizer.cs (1)
91? _span[nextIndex..]
Language\TagHelperBinder.cs (2)
143tagNameSpan = tagNameSpan[tagNamePrefixSpan.Length..]; 151parentTagNameSpan = parentTagNameSpan[tagNamePrefixSpan.Length..];
SourceGenerators\SourceGeneratorProjectEngine.cs (1)
114codeDocument = ExecutePhases(Phases[startIndex..(_rewritePhaseIndex + 1)], codeDocument, cancellationToken);
Microsoft.CodeAnalysis.ResxSourceGenerator (4)
src\roslyn\src\Compilers\Core\Portable\Hashing\XxHashShared.cs (3)
275source.Slice(0, loadSize).CopyTo(new Span<byte>(buffer + state.BufferedCount, loadSize)); 314source.Slice(sourceIndex - StripeLengthBytes, StripeLengthBytes).CopyTo(new Span<byte>(buffer + InternalBufferLengthBytes - StripeLengthBytes, StripeLengthBytes)); 327source.Slice(sourceIndex - StripeLengthBytes, StripeLengthBytes).CopyTo(new Span<byte>(buffer + InternalBufferLengthBytes - StripeLengthBytes, StripeLengthBytes));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\ObjectWriter.cs (1)
375span.Slice(offset, segmentLength).CopyTo(buffer.AsSpan());
Microsoft.CodeAnalysis.Workspaces (10)
FindSymbols\TopLevelSyntaxTree\NavigateToSearchIndex.NavigateToSearchInfo.cs (4)
265AddToSet(humpPrefixStrings, loweredName.Slice(part.Start, prefixLen)); 284AddToSet(ngramStrings, loweredName.Slice(ngramStart, ngramLength)); 383pattern = pattern[end..]; 539if (humpPrefixFilter.ProbablyContains(pattern[i..j]))
FindSymbols\TopLevelSyntaxTree\SparseNgramGenerator.cs (1)
255if (!filter.ProbablyContains(text.Slice(start, length)))
src\roslyn\src\Compilers\Core\Portable\Hashing\XxHashShared.cs (3)
275source.Slice(0, loadSize).CopyTo(new Span<byte>(buffer + state.BufferedCount, loadSize)); 314source.Slice(sourceIndex - StripeLengthBytes, StripeLengthBytes).CopyTo(new Span<byte>(buffer + InternalBufferLengthBytes - StripeLengthBytes, StripeLengthBytes)); 327source.Slice(sourceIndex - StripeLengthBytes, StripeLengthBytes).CopyTo(new Span<byte>(buffer + InternalBufferLengthBytes - StripeLengthBytes, StripeLengthBytes));
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\StringTable.cs (1)
509if (!chunk.Span.Equals(array.AsSpan().Slice(chunkOffset, chunk.Length), StringComparison.Ordinal))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\ObjectWriter.cs (1)
375span.Slice(offset, segmentLength).CopyTo(buffer.AsSpan());
Microsoft.Data.Analysis (5)
DataFrameColumns\ArrowStringDataFrameColumn.cs (1)
246return _dataBuffers[offsetsBufferIndex].ReadOnlySpan.Slice(currentOffset, numberOfBytes);
PrimitiveColumnContainer.BinaryOperations.cs (3)
136arithmetic.HandleOperation(operation, leftSpan.Slice(0, availableInRetSpan), rightSpan.Slice(0, availableInRetSpan), retSpan.Slice(retOffset)); 178arithmetic.HandleOperation(operation, leftSpan.Slice(0, availableInRetSpan), right, retSpan.Slice(retOffset));
ReadOnlyDataFrameBuffer.cs (1)
44get => (MemoryMarshal.Cast<byte, T>(ReadOnlyBuffer.Span)).Slice(0, Length);
Microsoft.Data.Analysis.Tests (6)
ArrayComparer.cs (6)
99Assert.True(expectedArray.Values.Slice(0, expectedArray.Length).SequenceEqual(actualArray.Values.Slice(0, actualArray.Length))); 113Assert.True(expectedArray.Values.Slice(0, booleanByteCount).SequenceEqual(actualArray.Values.Slice(0, booleanByteCount))); 126Assert.True(expectedArray.Values.Slice(0, expectedArray.Length).SequenceEqual(actualArray.Values.Slice(0, actualArray.Length)));
Microsoft.Diagnostics.DataContractReader (2)
ContractDescriptorTarget.cs (2)
603return new TargetPointer(Read<uint>(bytes.Slice(0, sizeof(uint)), _config.IsLittleEndian)); 607return new TargetPointer(Read<ulong>(bytes.Slice(0, sizeof(ulong)), _config.IsLittleEndian));
Microsoft.Diagnostics.DataContractReader.Contracts (2)
Contracts\DacStreams_1.cs (1)
117string name = Encoding.UTF8.GetString(miniMdBuffer.Slice((int)(currentAddress - miniMetaDataBuffAddress), stringLen));
Contracts\Debugger\Debugger_1.cs (1)
201ReadOnlySpan<byte> slice = record.Slice(numberParametersOffset, sizeof(uint));
Microsoft.Diagnostics.DataContractReader.Legacy (1)
OutputBufferHelpers.cs (1)
28strSpan = strSpan.Slice(0, nullTerminatorLocation);
Microsoft.Diagnostics.NETCore.Client (2)
DiagnosticsIpc\ProcessInfo.cs (2)
120ReadOnlySpan<char> noMetadataVersion = versionSpan.Slice(0, metadataIndex); 128return Version.TryParse(noMetadataVersion.Slice(0, prereleaseIndex).ToString(), out version);
Microsoft.Extensions.AI.Evaluation.NLP (3)
Common\NGramExtensions.cs (3)
35ReadOnlySpan<T> next = input.Slice(0, Math.Min(n, input.Length)); 42next = input.Slice(0, Math.Min(n, input.Length)); 78nGrams.Add(new NGram<T>(input.Slice(i, s)));
Microsoft.Extensions.AI.Evaluation.Quality (1)
Utilities\JsonOutputFixer.cs (1)
27if (trimmed.Length > markerLength && trimmed.Slice(0, markerLength).SequenceEqual(JsonMarker.AsSpan()))
Microsoft.Extensions.Compliance.Abstractions (1)
Classification\DataClassificationTypeConverter.cs (1)
103taxonomyName = valueSpan.Slice(0, index).ToString();
Microsoft.Extensions.Configuration (2)
ConfigurationKeyComparer.cs (2)
45xDelimiterIndex == -1 ? xSpan : xSpan.Slice(0, xDelimiterIndex), 46yDelimiterIndex == -1 ? ySpan : ySpan.Slice(0, yDelimiterIndex));
Microsoft.Extensions.Configuration.Binder.SourceGeneration (1)
src\runtime\src\libraries\Common\src\SourceGenerators\SourceWriter.cs (1)
108next = remainingText.Slice(0, lineLength);
Microsoft.Extensions.DataIngestion (3)
Chunkers\ElementsChunker.cs (3)
166int newLineIndex = remainingContent.Slice(0, index).LastIndexOf('\n'); 170tokenCount = CountTokens(remainingContent.Slice(0, index)); 174ReadOnlySpan<char> spanToAppend = remainingContent.Slice(0, index);
Microsoft.Extensions.DataIngestion.Markdig (2)
MarkdownParser.cs (2)
136ReadOnlySpan<char> mediaType = url.Slice(0, semicolonIndex); 143ReadOnlySpan<char> encoding = url.Slice(semicolonIndex + 1, commaIndex - semicolonIndex - 1);
Microsoft.Extensions.DataIngestion.MarkItDown (2)
src\Libraries\Microsoft.Extensions.DataIngestion.Markdig\MarkdownParser.cs (2)
136ReadOnlySpan<char> mediaType = url.Slice(0, semicolonIndex); 143ReadOnlySpan<char> encoding = url.Slice(semicolonIndex + 1, commaIndex - semicolonIndex - 1);
Microsoft.Extensions.Diagnostics.ResourceMonitoring (14)
Linux\LinuxUtilizationParserCgroupV1.cs (6)
136stat = stat.Slice(StartingTokens.Length, stat.Length - StartingTokens.Length); 223ReadOnlySpan<char> inactiveMemorySlice = memoryFile.Slice(index + TotalInactiveFile.Length, memoryFile.Length - index - TotalInactiveFile.Length); 271ReadOnlySpan<char> totalMemory = firstLine.Slice(MemTotal.Length, firstLine.Length - MemTotal.Length); 285ReadOnlySpan<char> unit = totalMemory.Slice(totalMemory.Length - 2, 2); 323ReadOnlySpan<char> group = groupIndex == -1 ? stats : stats.Slice(0, groupIndex); 342ReadOnlySpan<char> first = group.Slice(0, rangeIndex);
Linux\LinuxUtilizationParserCgroupV2.cs (7)
182stat = stat.Slice(StartingTokens.Length, stat.Length - StartingTokens.Length); 374ReadOnlySpan<char> inactiveMemorySlice = memoryFile.Slice(index + InactiveFile.Length, memoryFile.Length - index - InactiveFile.Length); 418ReadOnlySpan<char> totalMemory = firstLine.Slice(MemTotal.Length, firstLine.Length - MemTotal.Length); 432ReadOnlySpan<char> unit = totalMemory.Slice(totalMemory.Length - 2, 2); 470ReadOnlySpan<char> group = groupIndex == -1 ? stats : stats.Slice(0, groupIndex); 489ReadOnlySpan<char> first = group.Slice(0, rangeIndex); 695ReadOnlySpan<char> cpuPeriodSlice = quotaBuffer.Slice(index + quotaString.Length, quotaBuffer.Length - index - quotaString.Length);
Linux\Network\LinuxNetworkUtilizationParser.cs (1)
84ReadOnlySpan<char> tcpConnectionState = line.Slice(range[Target - 2].Start.Value, range[Target - 2].End.Value - range[Target - 2].Start.Value);
Microsoft.Extensions.FileProviders.Physical (1)
PhysicalFilesWatcher.cs (1)
952return (separator >= 0 ? remaining.Slice(0, separator) : remaining).ToString();
Microsoft.Extensions.Http.Diagnostics (6)
Http\HttpDependencyMetadataResolver.cs (3)
115routeSpan = routeSpan.Slice(0, routeSpan.Length - 1); 371requestRouteAsSpan = requestRouteAsSpan.Slice(0, requestRouteAsSpan.Length - 1); 405var nextDelimiterIndex = requestRouteAsSpan.Slice(i, requestPathEndIndex - i).IndexOf(trieCurrent.Delimiter) + i;
Logging\Internal\HttpRequestReader.cs (3)
177int eq = querySpan.Slice(start, end - start).IndexOf('='); 180var keySpan = querySpan.Slice(start, eq); 181var valueSpan = querySpan.Slice(start + eq + 1, end - (start + eq + 1));
Microsoft.Extensions.Logging.Console (2)
ConsoleControlCharacterSanitizer.cs (2)
35sanitized.Append(remaining.Slice(0, firstEscapedCharacterIndex)); 51sanitized.Append(remaining.Slice(0, next));
Microsoft.Extensions.Telemetry (11)
Http\HttpRouteFormatter.cs (5)
205_ = outputBuffer.AppendRedacted(redactor, httpPath.Slice(startIndex, length)); 212_ = outputBuffer.Append(httpPath.Slice(startIndex, length).ToString()); 221_ = outputBuffer.Append(httpPath.Slice(startIndex, length).ToString()); 246_ = outputBuffer.AppendRedacted(redactor, httpPath.Slice(startIndex, length)); 253_ = outputBuffer.Append(httpPath.Slice(startIndex, length).ToString());
Http\HttpRouteParser.cs (6)
256HttpRouteParameterRedactionMode.None => httpPath.Slice(startIndex, length).ToString(), 278return redactor.Redact(httpPathAsSpan.Slice(startIndex, length)); 281return httpPathAsSpan.Slice(startIndex, length).ToString(); 286return httpPathAsSpan.Slice(startIndex, length).ToString(); 308return redactor.Redact(httpPathAsSpan.Slice(startIndex, length)); 311return httpPathAsSpan.Slice(startIndex, length).ToString();
Microsoft.Maui.Controls.Xaml (1)
XamlLoader.cs (1)
431 var slice = xaml.AsSpan().Slice(index, fullName.Length);
Microsoft.Maui.Essentials (2)
Types\Shared\WebUtils.shared.cs (2)
41 segment = query.Slice(0, delimeterIndex); 58 name = segment.Slice(0, equalIndex).ToString();
Microsoft.Maui.Graphics (19)
Color.cs (19)
378 red = ParseInt(colorAsHex.Slice(0, 2)); 379 green = ParseInt(colorAsHex.Slice(2, 2)); 380 blue = ParseInt(colorAsHex.Slice(4, 2)); 381 alpha = ParseInt(colorAsHex.Slice(6, 2)); 406 red = ParseInt(colorAsHex.Slice(0, 2)); 407 green = ParseInt(colorAsHex.Slice(2, 2)); 408 blue = ParseInt(colorAsHex.Slice(4, 2)); 442 alpha = ParseInt(colorAsHex.Slice(0, 2)); 443 red = ParseInt(colorAsHex.Slice(2, 2)); 444 green = ParseInt(colorAsHex.Slice(4, 2)); 445 blue = ParseInt(colorAsHex.Slice(6, 2)); 930 value = value.Slice(op + 1, cp - op - 1); 935 quad0 = value.Slice(0, index); 941 quad1 = value.Slice(0, index); 947 quad2 = value.Slice(0, index); 972 value = value.Slice(op + 1, cp - op - 1); 977 triplet0 = value.Slice(0, index); 983 triplet1 = value.Slice(0, index); 1003 elem = elem.Slice(0, elem.Length - 1);
Microsoft.ML.Core (12)
Data\ReadOnlyMemoryUtils.cs (2)
226sb.AppendSpan(span.Slice(min, j - min)).Append(ch); 233sb.AppendSpan(span.Slice(min, j - min));
Utilities\BigArray.cs (5)
346src.Slice(0, firstSubArrayCapacity).CopyTo(_entries[maMin].AsSpan(miMin)); 349src.Slice(firstSubArrayCapacity, miLim).CopyTo(_entries[maMax]); 358src.Slice(0, srcSoFar).CopyTo(_entries[maMin].AsSpan(miMin)); 364src.Slice(srcSoFar, BlockSize).CopyTo(_entries[major]); 372src.Slice(srcSoFar, miLim).CopyTo(_entries[maMax]);
Utilities\DoubleParser.cs (2)
143if (!DoubleParser.TryParse(span.Slice(ich, span.Length - ich), out value, out ichEnd, flags)) 195if (!DoubleParser.TryParse(span.Slice(ich, span.Length - ich), out value, out ichEnd, flags))
Utilities\LineParser.cs (3)
33if (DoubleParser.TryParse(valuesToParse.Slice(toParseStartIndex, i - toParseStartIndex), out float parsed)) 40if (float.TryParse(valuesToParse.Slice(toParseStartIndex, i - toParseStartIndex).ToString(), out float parsed)) 50return (true, trimmedLine.Slice(0, firstSeparatorIndex).ToString(), values);
Microsoft.ML.CpuMath (11)
CpuMathUtils.cs (9)
56TensorPrimitives.Multiply(source.Slice(0, count), value, destination); 75TensorPrimitives.MultiplyAdd(source.Slice(0, count), scale, destination.Slice(0, count), destination); 97TensorPrimitives.MultiplyAdd(source.Slice(0, count), scale, destination.Slice(0, count), result.Slice(0, count)); 115TensorPrimitives.Add(source.Slice(0, count), destination.Slice(0, count), destination.Slice(0, count)); 136TensorPrimitives.Multiply(left.Slice(0, count), right.Slice(0, count), destination.Slice(0, count)); 194return TensorPrimitives.Dot(left.Slice(0, count), right.Slice(0, count));
CpuMathUtils.netcoreapp.cs (2)
443var value = TensorPrimitives.Distance(left.Slice(0, count), right.Slice(0, count));
Microsoft.ML.Data (8)
DataLoadSave\Text\TextLoaderParser.cs (3)
1232_sb.AppendSpan(span.Slice(ichRun, ichCur - ichRun)); 1266_sb.AppendSpan(span.Slice(ichRun, ichCur - ichRun - 1)); 1276_sb.AppendSpan(span.Slice(ichRun, ichCur - ichRun));
DataLoadSave\Text\TextSaver.cs (2)
841sb.AppendSpan(span.Slice(ichRun, ichCur - ichRun)); 848sb.AppendSpan(span.Slice(ichRun, ichCur - ichRun));
DataView\Transposer.cs (3)
1191_inputValue.GetValues().Slice(min, len).CopyTo(editor.Values); 1209_inputValue.GetIndices().Slice(smin, scount).CopyTo(editor.Indices); 1217_inputValue.GetValues().Slice(smin, scount).CopyTo(editor.Values);
Microsoft.ML.PCA (2)
PcaTrainer.cs (2)
538writer.WriteSinglesNoCount(_mean.GetValues().Slice(0, _dimension)); 544writer.WriteSinglesNoCount(_eigenVectors[i].GetValues().Slice(0, _dimension));
Microsoft.ML.Tokenizers (82)
Model\BPETokenizer.cs (10)
466EncodeWithCache(textSpanToEncode.Slice(split.Offset, split.Length), tokens, split.Offset, ref priorityQueue); 527EncodeToIdsWithCache(textSpanToEncode.Slice(split.Offset, split.Length), ids, maxTokenCount - ids.Count, out int length, ref priorityQueue); 588count += EncodeToIdsWithCache(textSpanToEncode.Slice(split.Offset, split.Length), null, maxTokenCount - count, out int length, ref priorityQueue); 668count += EncodeToIdsWithCache(textSpanToEncode.Slice(split.Offset, split.Length), null, maxTokenCount - count, out int length, ref priorityQueue); 722tokenCount += EncodeToIdsFromEndWithCache(textSpanToEncode.Slice(split.Offset, split.Length), null, maxTokenCount - tokenCount, out int textIndex, ref priorityQueue); 860span = span.Slice(0, span.Length - EndOfWordSuffix.Length); 957sSpan = sSpan.Slice(0, sSpan.Length - EndOfWordSuffix!.Length); 1036span = span.Slice(0, span.Length - EndOfWordSuffix.Length); 1206s = w.Slice(i, 2); 1211s = w.Slice(i, 1);
Model\CodeGenTokenizer.cs (6)
391EncodeInternal(null, textSpanToEncode.Slice(split.Offset, split.Length), tokens, addPrefixSpace, split.Offset, agenda); 632EncodeToIdsInternal(null, textSpanToEncode.Slice(split.Offset, split.Length), ids, agenda, out int length, maxTokenCount - ids.Count); 844count += EncodeToIdsInternal(null, textSpanToEncode.Slice(split.Offset, split.Length), null, agenda, out int length, maxTokenCount - count); 983tokenCount += EncodeToIdsFromEndInternal(null, textSpanToEncode.Slice(split.Offset, split.Length), null, agenda, out int textIndex, maxTokenCount - tokenCount); 1693if (!_mergeRanks.TryGetValue(textSpan.Slice(symbols[left].pieceSpan.Index, symbols[left].pieceSpan.Length), textSpan.Slice(symbols[right].pieceSpan.Index, symbols[right].pieceSpan.Length), out int rank))
Model\EnglishRobertaTokenizer.cs (4)
337foreach (EncodedToken t in EncodeInternal(textSpanToEncode.Slice(split.Offset, split.Length))) 441EncodeToIdsInternal(textSpanToEncode.Slice(split.Offset, split.Length), ids, out int length, maxTokenCount - ids.Count); 525count += EncodeToIdsInternal(textSpanToEncode.Slice(split.Offset, split.Length), null, out int length, maxTokenCount - count); 572tokenCount += EncodeToIdsFromEndInternal(textSpanToEncode.Slice(split.Offset, split.Length), null, out int textIndex, maxTokenCount - tokenCount);
Model\SentencePieceBpeModel.cs (28)
120EncodeInternal(text.Slice(currentOffset, Offset - currentOffset), addBeginOfSentence: false, addEndOfSentence: false, tokens); 123if (InternalSpecialTokens!.TryGetValue(text.Slice(Offset, Length), out int id)) 168if (_vocab.TryGetValue(text.Slice(symbols[index].pieceSpan.Index, symbols[index].pieceSpan.Length), out (int Id, float Score, byte Type) tokenInfo)) 184EncodeAsBytes(text.Slice(symbols[index].pieceSpan.Index, symbols[index].pieceSpan.Length), symbols[index].pieceSpan.Index); 262if (!_vocab.TryGetValue(text.Slice(pieceSpan.Index, pieceSpan.Length), out (int Id, float Score, byte Type) id)) 264EncodeAsBytes(text.Slice(pieceSpan.Index, pieceSpan.Length), pieceSpan.Index); 272tokens.Add(new EncodedToken(id.Id, text.Slice(pieceSpan.Index, pieceSpan.Length).ToString(), new Range(pieceSpan.Index, pieceSpan.Index + pieceSpan.Length))); 379idsCount += EncodeToIds(text.Slice(currentOffset, Offset - currentOffset), addBeginOfSentence: false, addEndOfSentence: false, accumulatedIds, out charsWritten, maxTokens - idsCount); 383if (idsCount < maxTokens && InternalSpecialTokens!.TryGetValue(text.Slice(Offset, Length), out int id)) 446if (_vocab.TryGetValue(text.Slice(symbols[index].pieceSpan.Index, symbols[index].pieceSpan.Length), out (int Id, float Score, byte Type) tokenInfo)) 462if (!EncodeAsBytes(text.Slice(symbols[index].pieceSpan.Index, symbols[index].pieceSpan.Length), symbols[index].pieceSpan.Index, ref charsConsumed)) 568if (!_vocab.TryGetValue(text.Slice(pieceSpan.Index, pieceSpan.Length), out (int Id, float Score, byte Type) id)) 570return EncodeAsBytes(text.Slice(pieceSpan.Index, pieceSpan.Length), pieceSpan.Index, ref charsConsumed); 656idsCount += CountTokens(text.Slice(currentOffset, Offset - currentOffset), addBeginOfSentence: false, addEndOfSentence: false, out charsWritten, maxTokens - idsCount); 660if (idsCount < maxTokens && InternalSpecialTokens!.TryGetValue(text.Slice(Offset, Length), out int id)) 714if (_vocab.TryGetValue(text.Slice(symbols[index].pieceSpan.Index, symbols[index].pieceSpan.Length), out (int Id, float Score, byte Type) tokenInfo)) 730if (!EncodeAsBytes(text.Slice(symbols[index].pieceSpan.Index, symbols[index].pieceSpan.Length), symbols[index].pieceSpan.Index, ref charsConsumed)) 827if (!_vocab.TryGetValue(text.Slice(pieceSpan.Index, pieceSpan.Length), out (int Id, float Score, byte Type) id)) 829return EncodeAsBytes(text.Slice(pieceSpan.Index, pieceSpan.Length), pieceSpan.Index, ref charsConsumed); 930if (InternalSpecialTokens!.TryGetValue(text.Slice(current.Offset, current.Length), out int id)) 939splitText = text.Slice(start, current.Offset - start); 990if (_vocab.TryGetValue(text.Slice(symbols[index].pieceSpan.Index, symbols[index].pieceSpan.Length), out (int Id, float Score, byte Type) tokenInfo)) 1006if (!EncodeAsBytesFromEnd(text.Slice(symbols[index].pieceSpan.Index, symbols[index].pieceSpan.Length), symbols[index].pieceSpan.Index, ref textIndex)) 1075int encodedCount = Helpers.GetUtf8Bytes(text.Slice(0, i + 1), utf8Bytes); 1103if (!_vocab.TryGetValue(text.Slice(pieceSpan.Index, pieceSpan.Length), out (int Id, float Score, byte Type) id)) 1105return EncodeAsBytesFromEnd(text.Slice(pieceSpan.Index, pieceSpan.Length), pieceSpan.Index, ref textIndex); 1198if (!_vocab.TryGetValue(textSpan.Slice(symbols[left].pieceSpan.Index, pieceLength), out (int Id, float Score, byte Type) leftId)) 1218=> _vocabReverse.TryGetValue(id, out string? token) ? token : text.Slice(index, length).ToString();
Model\SentencePieceUnigramModel.cs (14)
507EncodeToTokensInternal(text.Slice(currentOffset, Offset - currentOffset), considerNormalization, ref progressOffset, tokens, buffer, ref normalizedString, ref normalizedStringIndex); 510if (InternalSpecialTokens!.TryGetValue(text.Slice(Offset, Length), out int id)) 515StoreNormalizedText(text.Slice(Offset, Length), ref normalizedString, ref normalizedStringIndex); 945StoreNormalizedText(text.Slice(currentOffset, Offset - currentOffset), considerNormalization, buffer, ref normalizedString, ref normalizedStringIndex); 950EncodeToIdsInternal(text.Slice(currentOffset, Offset - currentOffset), considerNormalization, ids, buffer, ref normalizedString, ref normalizedStringIndex, ref charsConsumed, maxTokenCount); 954if (InternalSpecialTokens!.TryGetValue(text.Slice(Offset, Length), out int id)) 958StoreNormalizedText(text.Slice(Offset, Length), ref normalizedString, ref normalizedStringIndex); 1326StoreNormalizedText(text.Slice(currentOffset, Offset - currentOffset), considerNormalization, buffer, ref normalizedString, ref normalizedStringIndex); 1331CountTokensInternal(text.Slice(currentOffset, Offset - currentOffset), considerNormalization, ref tokenCount, buffer, ref normalizedString, ref normalizedStringIndex, ref charsConsumed, maxTokenCount); 1335if (InternalSpecialTokens!.TryGetValue(text.Slice(Offset, Length), out int id)) 1339StoreNormalizedText(text.Slice(Offset, Length), ref normalizedString, ref normalizedStringIndex); 1612if (InternalSpecialTokens!.TryGetValue(text.Slice(current.Offset, current.Length), out int id)) 1622StoreNormalizedTextFromEnd(text.Slice(current.Offset, current.Length), ref normalizedString, ref normalizedStringCountFromEnd); 1628GetIndexByTokenCountFromEndInternal(text.Slice(start, current.Offset - start), considerNormalization, ref tokenCount, buffer, ref normalizedString, ref normalizedStringCountFromEnd, ref charConsumedFromEnd, maxTokenCount);
Model\TiktokenTokenizer.cs (6)
282EncodeToTokens(textSpanToEncode.Slice(split.Offset, split.Length), tokens, split.Offset); 309value[i].TokenLength == 0 ? string.Empty : text.Slice(value[i].TokenIndex, value[i].TokenLength).ToString(), 350encodedTokens[i].TokenLength == 0 ? string.Empty : text.Slice(encodedTokens[i].TokenIndex, encodedTokens[i].TokenLength).ToString(), 393EncodeToIds(textSpanToEncode.Slice(split.Offset, split.Length), ids, out int length, maxTokenCount - ids.Count); 560count += CountTokens(textSpanToEncode.Slice(split.Offset, split.Length), out int length, maxTokenCount - count); 687tokenCount += CountTokensFromEnd(textSpanToEncode.Slice(split.Offset, split.Length), out int textIndex, maxTokenCount - tokenCount);
Model\WordPieceTokenizer.cs (6)
296EncodeToTokens(textSpanToEncode.Slice(split.Offset, split.Length), tokens, split.Offset); 341scoped ReadOnlySpan<char> subStr = text.Slice(start, end - start); 420EncodeToIds(textSpanToEncode.Slice(split.Offset, split.Length), ids, out int length, maxTokenCount - ids.Count); 482scoped ReadOnlySpan<char> subStr = text.Slice(start, end - start); 570count += EncodeToIds(textSpanToEncode.Slice(split.Offset, split.Length), accumulatedIds: null, out int length, maxTokenCount - count); 649int count = EncodeToIds(textSpanToEncode.Slice(split.Offset, split.Length), accumulatedIds: null, out charsConsumed, settings.MaxTokenCount - tokenCount);
Normalizer\BertNormalizer.cs (1)
85int length = original.AsSpan().Slice(i, inc + 1).ToLowerInvariant(casingBuffer);
Normalizer\SentencePieceNormalizer.cs (4)
261if (startIndex + tokenLength <= endIndex && original.Slice(startIndex, tokenLength).SequenceEqual(token.AsSpan())) 439ReadOnlySpan<byte> normalizedByte = normalizedPrefix.Length == 0 ? input.Slice(0, p) : normalizedPrefix.Span; 470ReadOnlySpan<byte> sp = normalizedPrefix.Length == 0 ? input.Slice(0, p) : normalizedPrefix.Span; 607fixed (byte* pBlob = blob.Slice(0, (int)trieBlobSize))
PreTokenizer\PreTokenizer.cs (1)
180foreach (ValueMatch m in regex.EnumerateMatches(text.Slice(beginning, length)))
RegexGenerator.g.cs (2)
559(charloop_ending_pos = inputSpan.Slice(charloop_starting_pos, charloop_ending_pos - charloop_starting_pos).LastIndexOfAny('\n', '\r')) < 0) 1750(charloop_ending_pos7 = inputSpan.Slice(charloop_starting_pos7, charloop_ending_pos7 - charloop_starting_pos7).LastIndexOfAny('\n', '\r')) < 0)
Microsoft.ML.Tokenizers.Tests (1)
UnigramTests.cs (1)
551Assert.Equal(decodedString.AsSpan().Slice(0, charsWritten).ToString(), buffer.AsSpan().Slice(0, charsWritten).ToString());
Microsoft.ML.Transforms (6)
Text\LdaSingleBox.cs (2)
206termID.Slice(0, termNum).CopyTo(pID); 273termID.Slice(0, termNum).CopyTo(pID);
Text\TextNormalizing.cs (4)
404buffer.AppendSpan(span.Slice(min, i - min)); 414buffer.AppendSpan(span.Slice(min, i - min)); 431buffer.AppendSpan(span.Slice(min, i - min)).Append(ch); 447buffer.AppendSpan(span.Slice(min, len));
Microsoft.NET.HostModel (1)
ComHost\TypeLibReader.cs (1)
48return new Guid(fileContents.Slice(fileOffset + typelibGuidEntryOffset, 16).ToArray());
Microsoft.Net.Http.Headers (2)
MediaTypeHeaderValue.cs (2)
647mediaType = string.Concat(input.AsSpan().Slice(startIndex, typeLength), "/", input.AsSpan().Slice(current, subtypeLength));
Microsoft.NET.Sdk.StaticWebAssets.Tasks (4)
FingerprintPatternMatcher.cs (1)
111relativePathCandidateMemory.Slice(0, relativePathCandidateMemory.Length - pattern.Length - 1);
Utils\Globbing\PathTokenizer.cs (3)
91!_path.Slice(range.Start.Value, length).Equals(".".AsSpan(), StringComparison.Ordinal) && 92!_path.Slice(range.Start.Value, length).Equals("..".AsSpan(), StringComparison.Ordinal)) 111public ReadOnlySpan<char> this[int index] => _path.Slice(segments[index + _index].Start, segments[index + _index].Length);
Microsoft.NET.StringTools (1)
SpanBasedStringBuilder.cs (1)
180if (!MemoryExtensions.Equals(other.Slice(otherIndex, internalSpan.Length), internalSpan.Span, comparison))
Microsoft.Private.Windows.Core (8)
_generated\151\Windows.Win32.InlineArrayIndexerExtensions.g.cs (1)
26 return length < 0 ? value : value.Slice(0, length);
_generated\214\Windows.Win32.RECT.InlineArrays.g.cs (2)
34 new ReadOnlySpan<winmdroot.Foundation.RECT>(p0, SpanLength).Slice(0, length).CopyTo(target); 40 return new ReadOnlySpan<winmdroot.Foundation.RECT>(p0, SpanLength).Slice(0, length).ToArray();
_generated\37\Windows.Win32.char.InlineArrays.g.cs (2)
65 internal readonly string ToString(int length) => AsReadOnlySpan().Slice(0, length).ToString(); 129 internal readonly string ToString(int length) => AsReadOnlySpan().Slice(0, length).ToString();
System\SpanReader.cs (3)
27set => _unread = Span[value..]; 241public void Advance(int count) => _unread = _unread[count..]; 280span = span.Slice(start, length);
Microsoft.Win32.Registry (2)
Microsoft\Win32\RegistryKey.cs (1)
1143toAdd = chars.Slice(0, nullPos).ToString();
src\runtime\src\libraries\Common\src\Interop\Windows\Kernel32\Interop.FormatMessage.cs (1)
85return buffer.Slice(0, length).ToString();
MSBuild (1)
CommandLine\CommandLineParser.cs (1)
209ReadOnlySpan<char> switchNameSpan = colonIndex >= 0 ? switchPart.Slice(0, colonIndex) : switchPart;
NuGet.Commands (1)
RestoreCommand\ContentFiles\ContentFileUtils.cs (1)
251lockFileItem.Path.AsSpan().Slice(0, lockFileItem.Path.Length - 3));
PresentationBuildTasks (3)
src\wpf\src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\ReflectionUtils.cs (3)
66fullName = fullName.Slice(0, fullName.Length - nameSlice.Length + commaIndex); 110assemblyVersion = assemblyName.Slice(versionIndex + Version.Length, tokenLength - Version.Length); 122assemblyToken = assemblyName.Slice(tokenIndex + PublicKeyToken.Length, tokenLength - PublicKeyToken.Length);
PresentationCore (3)
MS\Internal\FontCache\FamilyCollection.cs (1)
494faceName = faceName.Slice(0, indexOfSpace);
MS\Internal\IO\Packaging\ByteRangeDownloader.cs (1)
790int lastByteOffset = Int32.Parse(contentRangeSpan.Slice(0, index), NumberStyles.None, NumberFormatInfo.InvariantInfo);
System\Windows\TextDecorationCollectionConverter.cs (1)
94ReadOnlySpan<char> decoration = decorationsSpan[segment].Trim();
PresentationFramework (33)
Microsoft\Win32\FileDialog.cs (2)
729int i = exts[ext].LastIndexOf('.'); 735extensions.Add(exts[ext].Slice(i + 1).ToString());
MS\Internal\Annotations\Anchoring\FixedTextSelectionProcessor.cs (4)
505start = GetPoint(segmentValueSpan[splitRegions[0]], segmentValueSpan[splitRegions[1]]); 506end = GetPoint(segmentValueSpan[splitRegions[2]], segmentValueSpan[splitRegions[3]]);
MS\Internal\Annotations\Anchoring\TextSelectionProcessor.cs (2)
444startOffset = int.Parse(segmentString[splitRegions[0]], NumberFormatInfo.InvariantInfo); 445endOffset = int.Parse(segmentString[splitRegions[1]], NumberFormatInfo.InvariantInfo);
MS\Internal\Globalization\BamlResourceContent.cs (6)
104stringBuilder.Append(contentSpan.Slice(0, firstEscapeToken)); 133if (contentSpan.Slice(0, 6).SequenceEqual("&quot;")) 139else if (contentSpan.Slice(0, 6).SequenceEqual("&apos;")) 148if (contentSpan.Slice(0, 5).SequenceEqual("&amp;")) 157if (contentSpan.Slice(0, 4).SequenceEqual("&lt;")) 163else if (contentSpan.Slice(0, 4).SequenceEqual("&gt;"))
System\Windows\Annotations\Annotation.cs (3)
636ReadOnlySpan<char> name = typeName[segments[0]]; 646ReadOnlySpan<char> @namespace = typeName[segments[0]]; 647ReadOnlySpan<char> name = typeName[segments[1]];
System\Windows\Controls\DataGridLengthConverter.cs (1)
258ReadOnlySpan<char> valueString = valueSpan.Slice(0, valueSpan.Length - strLenUnit);
System\Windows\Controls\VirtualizingStackPanel.cs (3)
12001_fileName = traceSplits[splitRegions[0]].ToString(); 12005if (int.TryParse(traceSplits[splitRegions[1]], NumberStyles.Integer, CultureInfo.InvariantCulture, out int flushDepth)) 12013if (int.TryParse(traceSplits[splitRegions[2]], NumberStyles.Integer, CultureInfo.InvariantCulture, out int luThreshold))
System\Windows\Documents\FixedSchema.cs (1)
444return new string[] { attrValueSpan.Slice(0, spacePos).ToString() };
System\Windows\Documents\Glyphs.cs (3)
416ReadOnlySpan<char> characterClusterSpec = valueSpec.Slice(firstBracket + 1, secondBracket - (firstBracket + 1)); 424ReadOnlySpan<char> characterClusterSpec = valueSpec.Slice(firstBracket + 1, colon - (firstBracket + 1)); 426ReadOnlySpan<char> glyphClusterSpec = valueSpec.Slice(colon + 1, secondBracket - (colon + 1));
System\Windows\Documents\TextStore.cs (2)
4666_fileName = traceSplits[splitRegions[0]].ToString(); 4670if (int.TryParse(traceSplits[splitRegions[1]], NumberStyles.Integer, CultureInfo.InvariantCulture, out int flushDepth))
System\Windows\Documents\XamlToRtfWriter.cs (2)
3561s = s.Slice(0, n + 1); 3823ReadOnlySpan<char> onenum = thickness.Slice(s, e - s);
System\Windows\LengthConverter.cs (1)
204valueSpan = valueSpan.Slice(0, valueSpan.Length - pixelUnit.Name.Length);
System\Windows\Markup\XamlFigureLengthSerializer.cs (1)
240ReadOnlySpan<char> valueString = valueSpan.Slice(0, valueSpan.Length - strLenUnit);
System\Windows\Markup\XamlGridLengthSerializer.cs (1)
240ReadOnlySpan<char> valueString = valueSpan.Slice(0, valueSpan.Length - strLenUnit);
System\Windows\ThemeDictionaryExtension.cs (1)
138return GenerateUri(info.AssemblyName, resourceName, nameSpan[splitRegions[1]]);
PresentationUI (1)
MS\Internal\Documents\DocumentApplicationDocumentViewer.cs (1)
1868zoomString = zoomString.Slice(0, zoomString.Length - 1);
Roslyn.Diagnostics.Analyzers (4)
src\roslyn\src\Compilers\Core\Portable\Hashing\XxHashShared.cs (3)
275source.Slice(0, loadSize).CopyTo(new Span<byte>(buffer + state.BufferedCount, loadSize)); 314source.Slice(sourceIndex - StripeLengthBytes, StripeLengthBytes).CopyTo(new Span<byte>(buffer + InternalBufferLengthBytes - StripeLengthBytes, StripeLengthBytes)); 327source.Slice(sourceIndex - StripeLengthBytes, StripeLengthBytes).CopyTo(new Span<byte>(buffer + InternalBufferLengthBytes - StripeLengthBytes, StripeLengthBytes));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\ObjectWriter.cs (1)
375span.Slice(offset, segmentLength).CopyTo(buffer.AsSpan());
Shared (2)
ServerSentEvents\SseFormatter.cs (1)
161ReadOnlySpan<byte> nextLine = data.Slice(0, lineLength);
ServerSentEvents\SseParser_1.cs (1)
364fieldName = line.Slice(0, colonPos);
System.Collections.Immutable (13)
System\Collections\Frozen\String\OrdinalStringFrozenDictionary_LeftJustifiedCaseInsensitiveAsciiSubstring.cs (1)
28private protected override int GetHashCode(ReadOnlySpan<char> s) => Hashing.GetHashCodeOrdinalIgnoreCaseAscii(s.Slice(HashIndex, HashCount));
System\Collections\Frozen\String\OrdinalStringFrozenDictionary_LeftJustifiedCaseInsensitiveSubstring.cs (1)
28private protected override int GetHashCode(ReadOnlySpan<char> s) => Hashing.GetHashCodeOrdinalIgnoreCase(s.Slice(HashIndex, HashCount));
System\Collections\Frozen\String\OrdinalStringFrozenDictionary_LeftJustifiedSubstring.cs (1)
28private protected override int GetHashCode(ReadOnlySpan<char> s) => Hashing.GetHashCodeOrdinal(s.Slice(HashIndex, HashCount));
System\Collections\Frozen\String\OrdinalStringFrozenDictionary_RightJustifiedCaseInsensitiveAsciiSubstring.cs (1)
28private protected override int GetHashCode(ReadOnlySpan<char> s) => Hashing.GetHashCodeOrdinalIgnoreCaseAscii(s.Slice(s.Length + HashIndex, HashCount));
System\Collections\Frozen\String\OrdinalStringFrozenDictionary_RightJustifiedCaseInsensitiveSubstring.cs (1)
28private protected override int GetHashCode(ReadOnlySpan<char> s) => Hashing.GetHashCodeOrdinalIgnoreCase(s.Slice(s.Length + HashIndex, HashCount));
System\Collections\Frozen\String\OrdinalStringFrozenDictionary_RightJustifiedSubstring.cs (1)
28private protected override int GetHashCode(ReadOnlySpan<char> s) => Hashing.GetHashCodeOrdinal(s.Slice(s.Length + HashIndex, HashCount));
System\Collections\Frozen\String\OrdinalStringFrozenSet_LeftJustifiedCaseInsensitiveAsciiSubstring.cs (1)
27private protected override int GetHashCode(ReadOnlySpan<char> s) => Hashing.GetHashCodeOrdinalIgnoreCaseAscii(s.Slice(HashIndex, HashCount));
System\Collections\Frozen\String\OrdinalStringFrozenSet_LeftJustifiedCaseInsensitiveSubstring.cs (1)
27private protected override int GetHashCode(ReadOnlySpan<char> s) => Hashing.GetHashCodeOrdinalIgnoreCase(s.Slice(HashIndex, HashCount));
System\Collections\Frozen\String\OrdinalStringFrozenSet_LeftJustifiedSubstring.cs (1)
25private protected override int GetHashCode(ReadOnlySpan<char> s) => Hashing.GetHashCodeOrdinal(s.Slice(HashIndex, HashCount));
System\Collections\Frozen\String\OrdinalStringFrozenSet_RightJustifiedCaseInsensitiveAsciiSubstring.cs (1)
27private protected override int GetHashCode(ReadOnlySpan<char> s) => Hashing.GetHashCodeOrdinalIgnoreCaseAscii(s.Slice(s.Length + HashIndex, HashCount));
System\Collections\Frozen\String\OrdinalStringFrozenSet_RightJustifiedCaseInsensitiveSubstring.cs (1)
27private protected override int GetHashCode(ReadOnlySpan<char> s) => Hashing.GetHashCodeOrdinalIgnoreCase(s.Slice(s.Length + HashIndex, HashCount));
System\Collections\Frozen\String\OrdinalStringFrozenSet_RightJustifiedSubstring.cs (1)
25private protected override int GetHashCode(ReadOnlySpan<char> s) => Hashing.GetHashCodeOrdinal(s.Slice(s.Length + HashIndex, HashCount));
System\Collections\Immutable\ImmutableList_1.Node.cs (1)
275Node left = NodeTreeFromList(items.Slice(0, leftCount));
System.ComponentModel.Annotations (3)
System\ComponentModel\DataAnnotations\PhoneAttribute.cs (3)
76return potentialPhoneNumber.Slice(0, lastIndexOfExtension); 88return potentialPhoneNumber.Slice(0, lastIndexOfExtension); 100return potentialPhoneNumber.Slice(0, lastIndexOfExtension);
System.ComponentModel.TypeConverter (9)
src\runtime\src\libraries\Common\src\System\Drawing\ColorConverterCommon.cs (8)
641 => PossibleKnownColor(Color.FromArgb(IntFromString(textSpan[tokens[0]], culture))), 653 => PossibleKnownColor(Color.FromArgb(IntFromString(textSpan[tokens[0]], culture), IntFromString(textSpan[tokens[1]], culture), IntFromString(textSpan[tokens[2]], culture))), 664 => PossibleKnownColor(Color.FromArgb(IntFromString(textSpan[tokens[0]], culture), IntFromString(textSpan[tokens[1]], culture), IntFromString(textSpan[tokens[2]], culture), IntFromString(textSpan[tokens[3]], culture))),
System\ComponentModel\Design\Serialization\RootDesignerSerializerAttribute.cs (1)
86baseType = baseType.Slice(0, comma);
System.Console (3)
System\ConsolePal.Unix.cs (1)
656dst.AppendExtraBuffer(src.Slice(i, 1));
System\IO\KeyParser.cs (2)
134key = MapEscapeSequenceNumber(byte.Parse(input.Slice(SequencePrefixLength, digitCount))); 165? MapEscapeSequenceNumber(byte.Parse(input.Slice(SequencePrefixLength, digitCount)))
System.Diagnostics.DiagnosticSource (14)
System\Diagnostics\Activity.cs (2)
2025if (!Utf8Parser.TryParse(idData.Slice(0, 16), out span[0], out _, 'x')) 2032if (!Utf8Parser.TryParse(idData.Slice(16, 16), out span[1], out _, 'x'))
System\Diagnostics\DsesFilterAndTransform.cs (5)
229activitySourceName = entry.Slice(0, eventNameIndex).Trim(); 236eventName = suffixPart.Slice(0, samplingResultIndex).Trim(); 253|| !double.TryParse(suffixPart.Slice(c_ParentRatioSamplerPrefix.Length, endingLocation - c_ParentRatioSamplerPrefix.Length), NumberStyles.Float, CultureInfo.InvariantCulture, out double ratio)) 267suffixPart.Slice(c_ParentRateLimitingSamplerPrefix.Length, endingLocation - c_ParentRateLimitingSamplerPrefix.Length), 324activitySourceName = activitySourceName.Slice(0, plusSignIndex).Trim();
System\Diagnostics\Metrics\TagList.netcore.cs (2)
280tags = tags.Slice(0, _tagsCount); 309((ReadOnlySpan<KeyValuePair<string, object?>>)_tags).Slice(0, _tagsCount);
System\Diagnostics\W3CPropagator.cs (5)
116ReadOnlySpan<char> currentEntry = entrySeparator >= 0 ? baggageSpan.Slice(0, entrySeparator) : baggageSpan; 126ReadOnlySpan<char> keySpan = currentEntry.Slice(0, keyValueSeparator); 169ReadOnlySpan<char> entry = commaIndex >= 0 ? traceStateSpan.Slice(0, commaIndex) : traceStateSpan; 194ReadOnlySpan<char> key = entry.Slice(0, equalIndex); 515vsb.Append(value.Slice(0, indexOfInvalidCharacter));
System.Diagnostics.FileVersionInfo (4)
System\Diagnostics\FileVersionInfo.Unix.cs (4)
209major = ParseUInt16UntilNonDigit(versionSpan[parts[0]], out bool endedEarly); 212minor = ParseUInt16UntilNonDigit(versionSpan[parts[1]], out endedEarly); 215build = ParseUInt16UntilNonDigit(versionSpan[parts[2]], out endedEarly); 218priv = ParseUInt16UntilNonDigit(versionSpan[parts[3]], out _);
System.Diagnostics.PerformanceCounter (2)
src\runtime\src\libraries\Common\src\Interop\Windows\Advapi32\Interop.PERF_INFO.cs (1)
111: MemoryMarshal.Cast<byte, char>(data.Slice(instance.NameOffset, instance.NameLength - sizeof(char))); // NameLength includes the null-terminator
src\runtime\src\libraries\Common\src\Interop\Windows\Kernel32\Interop.FormatMessage.cs (1)
85return buffer.Slice(0, length).ToString();
System.Diagnostics.Process (10)
src\runtime\src\libraries\Common\src\Interop\Linux\cgroups\Interop.cgroups.cs (2)
421if (lineSpan[lineParts[0]] is "0" && lineSpan[lineParts[1]].IsEmpty)
src\runtime\src\libraries\Common\src\Interop\Linux\procfs\Interop.ProcFsStat.TryReadStatusFile.cs (1)
88switch (line.Slice(0, startIndex)) // name
src\runtime\src\libraries\Common\src\Interop\Linux\procfs\Interop.ProcMountInfo.TryParseMountInfoLine.cs (4)
43ReadOnlySpan<char> root = line[fields.Current]; 50ReadOnlySpan<char> mountPoint = line[fields.Current]; 67ReadOnlySpan<char> fileSystemType = line[fields.Current]; 80ReadOnlySpan<char> superOptions = line[fields.Current];
System\Diagnostics\Process.Linux.cs (2)
257string? name = GetUntruncatedNameFromArg(argRemainder.Slice(0, argEnd), prefix: stat.comm); 268name = GetUntruncatedNameFromArg(argRemainder.Slice(0, argEnd), prefix: stat.comm);
System\Diagnostics\Process.Multiplexing.cs (1)
207&& byteBuffer.Slice(0, preamble.Length).SequenceEqual(preamble))
System.Drawing.Common (2)
System\Drawing\Icon.cs (1)
541ReadOnlySpan<byte> bestImage = reader.Span.Slice((int)_bestImageOffset, (int)_bestBytesInRes);
System\Drawing\Imaging\ColorPalette.cs (1)
70new((int)buffer[0], ARGB.ToColorArray(buffer.Slice(2, (int)buffer[1])));
System.Drawing.Primitives (8)
src\runtime\src\libraries\Common\src\System\Drawing\ColorConverterCommon.cs (8)
641 => PossibleKnownColor(Color.FromArgb(IntFromString(textSpan[tokens[0]], culture))), 653 => PossibleKnownColor(Color.FromArgb(IntFromString(textSpan[tokens[0]], culture), IntFromString(textSpan[tokens[1]], culture), IntFromString(textSpan[tokens[2]], culture))), 664 => PossibleKnownColor(Color.FromArgb(IntFromString(textSpan[tokens[0]], culture), IntFromString(textSpan[tokens[1]], culture), IntFromString(textSpan[tokens[2]], culture), IntFromString(textSpan[tokens[3]], culture))),
System.Formats.Asn1 (120)
System\Formats\Asn1\AsnCharacterStringEncodings.cs (1)
339bytes.Slice(i, 2).ToArray(),
System\Formats\Asn1\AsnDecoder.BitString.cs (2)
524ReadOnlySpan<byte> topSpan = source.Slice(topOffset, topLength); 574ReadOnlySpan<byte> tmpSpan = source.Slice(topOffset, topLength);
System\Formats\Asn1\AsnDecoder.cs (5)
642return source.Slice(0, len); 654return source.Slice(offset, length); 673return source.Slice(offset, lengthVal); 1003return _data.Slice(0, bytesConsumed); 1027return _data.Slice(contentOffset, contentLength);
System\Formats\Asn1\AsnDecoder.OctetString.cs (2)
389ReadOnlySpan<byte> topSpan = source.Slice(topOffset, topLength); 438ReadOnlySpan<byte> topSpan = source.Slice(topOffset, topLength);
System\Formats\Asn1\AsnDecoder.Sequence.cs (1)
194ValueAsnReader ret = new ValueAsnReader(_data.Slice(contentStart, contentLength), RuleSet, _options);
System\Formats\Asn1\AsnDecoder.SetOf.cs (2)
111ReadOnlySpan<byte> current = remaining.Slice(0, consumed); 318ValueAsnReader ret = new ValueAsnReader(_data.Slice(contentOffset, contentLength), RuleSet, _options);
System\Formats\Asn1\AsnWriter.BitString.cs (1)
174remainingData.Slice(0, MaxCERContentSize).CopyTo(dest);
System\Formats\Asn1\AsnWriter.OctetString.cs (1)
151remainingData.Slice(0, MaxCERSegmentSize).CopyTo(dest);
System\Formats\Asn1\WellKnownOids.cs (105)
235"1.2.840.10040.4.1" => data.Slice(0, 7), // DSA 236"1.2.840.10040.4.3" => data.Slice(7, 7), // DSAWithSha1 237"1.2.840.10045.2.1" => data.Slice(14, 7), // EC 238"1.2.840.10045.1.1" => data.Slice(21, 7), // EcPrimeField 239"1.2.840.10045.1.2" => data.Slice(28, 7), // EcChar2Field 240"1.2.840.10045.3.1.7" => data.Slice(35, 8), // Secp256r1 241"1.2.840.10045.4.1" => data.Slice(43, 7), // ECDSAWithSha1 242"1.2.840.10045.4.3.2" => data.Slice(50, 8), // ECDSAWithSha256 243"1.2.840.10045.4.3.3" => data.Slice(58, 8), // ECDSAWithSha384 244"1.2.840.10045.4.3.4" => data.Slice(66, 8), // ECDSAWithSha512 245"1.2.840.113549.1.1.1" => data.Slice(74, 9), // RSA 246"1.2.840.113549.1.1.5" => data.Slice(83, 9), // RSAWithSha1 247"1.2.840.113549.1.1.7" => data.Slice(92, 9), // RSAOAEP 248"1.2.840.113549.1.1.8" => data.Slice(101, 9), // MGF1 249"1.2.840.113549.1.1.9" => data.Slice(110, 9), // OaepPSpecified 250"1.2.840.113549.1.1.10" => data.Slice(119, 9), // RSAPSS 251"1.2.840.113549.1.1.11" => data.Slice(128, 9), // RSAWithSha256 252"1.2.840.113549.1.1.12" => data.Slice(137, 9), // RSAWithSha384 253"1.2.840.113549.1.1.13" => data.Slice(146, 9), // RSAWithSha512 254"1.2.840.113549.1.5.3" => data.Slice(155, 9), // PbeWithMD5AndDESCBC 255"1.2.840.113549.1.5.10" => data.Slice(164, 9), // PbeWithSha1AndDESCBC 256"1.2.840.113549.1.5.11" => data.Slice(173, 9), // PbeWithSha1AndRC2CBC 257"1.2.840.113549.1.5.12" => data.Slice(182, 9), // Pbkdf2 258"1.2.840.113549.1.5.13" => data.Slice(191, 9), // PasswordBasedEncryptionScheme2 259"1.2.840.113549.1.7.1" => data.Slice(200, 9), // Pkcs7Data 260"1.2.840.113549.1.7.2" => data.Slice(209, 9), // Pkcs7SignedData 261"1.2.840.113549.1.7.3" => data.Slice(218, 9), // Pkcs7EnvelopedData 262"1.2.840.113549.1.7.6" => data.Slice(227, 9), // Pkcs7EncryptedData 263"1.2.840.113549.1.9.1" => data.Slice(236, 9), // Pkcs9EmailAddress 264"1.2.840.113549.1.9.3" => data.Slice(245, 9), // Pkcs9ContentType 265"1.2.840.113549.1.9.4" => data.Slice(254, 9), // Pkcs9MessageDigest 266"1.2.840.113549.1.9.5" => data.Slice(263, 9), // Pkcs9SigningTime 267"1.2.840.113549.1.9.6" => data.Slice(272, 9), // Pkcs9CounterSigner 268"1.2.840.113549.1.9.7" => data.Slice(281, 9), // Pkcs9Challenge 269"1.2.840.113549.1.9.14" => data.Slice(290, 9), // Pkcs9ExtensionRequest 270"1.2.840.113549.1.9.15" => data.Slice(299, 9), // Pkcs9SMimeCapabilities 271"1.2.840.113549.1.9.16.1.4" => data.Slice(308, 11), // TstInfo 272"1.2.840.113549.1.9.16.2.12" => data.Slice(319, 11), // SigningCertificateAttr 273"1.2.840.113549.1.9.16.2.14" => data.Slice(330, 11), // SignatureTimeStampAttr 274"1.2.840.113549.1.9.16.2.47" => data.Slice(341, 11), // SigningCertificateV2Attr 275"1.2.840.113549.1.9.20" => data.Slice(352, 9), // Pkcs9FriendlyName 276"1.2.840.113549.1.9.21" => data.Slice(361, 9), // LocalKeyId 277"1.2.840.113549.1.9.22.1" => data.Slice(370, 10), // Pkcs12X509CertType 278"1.2.840.113549.1.12.1.3" => data.Slice(380, 10), // Pkcs12TripleDes 279"1.2.840.113549.1.12.1.5" => data.Slice(390, 10), // Pkcs12Rc2Cbc128 280"1.2.840.113549.1.12.1.6" => data.Slice(400, 10), // Pkcs12Rc2Cbc40 281"1.2.840.113549.1.12.10.1.1" => data.Slice(410, 11), // Pkcs12KeyBag 282"1.2.840.113549.1.12.10.1.2" => data.Slice(421, 11), // Pkcs12ShroudedKeyBag 283"1.2.840.113549.1.12.10.1.3" => data.Slice(432, 11), // Pkcs12CertBag 284"1.2.840.113549.1.12.10.1.5" => data.Slice(443, 11), // Pkcs12SecretBag 285"1.2.840.113549.1.12.10.1.6" => data.Slice(454, 11), // Pkcs12SafeContentsBag 286"1.2.840.113549.2.5" => data.Slice(465, 8), // MD5 287"1.2.840.113549.2.7" => data.Slice(473, 8), // HMACSHA1 288"1.2.840.113549.2.9" => data.Slice(481, 8), // HMACSHA256 289"1.2.840.113549.2.10" => data.Slice(489, 8), // HMACSHA384 290"1.2.840.113549.2.11" => data.Slice(497, 8), // HMACSHA512 291"1.2.840.113549.3.2" => data.Slice(505, 8), // RC2CBC 292"1.2.840.113549.3.7" => data.Slice(513, 8), // TripleDESCBC 293"1.3.6.1.4.1.311.17.1" => data.Slice(521, 9), // Pkcs12KeyProviderName 294"1.3.6.1.4.1.311.17.3.20" => data.Slice(530, 10), // KeyIdentifier 295"1.3.6.1.4.1.311.20.2.3" => data.Slice(540, 10), // UserPrincipalName 296"1.3.6.1.4.1.311.88.2.1" => data.Slice(550, 10), // DocumentNameAttr 297"1.3.6.1.4.1.311.88.2.2" => data.Slice(560, 10), // DocumentDescriptionAttr 298"1.3.6.1.5.5.7.3.1" => data.Slice(570, 8), // KeyPurposeTlsServer 299"1.3.6.1.5.5.7.3.2" => data.Slice(578, 8), // KeyPurposeTlsClient 300"1.3.6.1.5.5.7.3.3" => data.Slice(586, 8), // KeyPurposeCodeSign 301"1.3.6.1.5.5.7.3.4" => data.Slice(594, 8), // KeyPurposeEmailProtection 302"1.3.6.1.5.5.7.3.8" => data.Slice(602, 8), // KeyPurposeTimestamping 303"1.3.6.1.5.5.7.3.9" => data.Slice(610, 8), // KeyPurposeOcspSigner 304"1.3.6.1.5.5.7.6.2" => data.Slice(618, 8), // Pkcs7NoSignature 305"1.3.6.1.5.5.7.48.1" => data.Slice(626, 8), // OCSP 306"1.3.6.1.5.5.7.48.1.2" => data.Slice(634, 9), // OcspNonce 307"1.3.6.1.5.5.7.48.2" => data.Slice(643, 8), // CAIssuers 308"1.3.14.3.2.26" => data.Slice(651, 5), // SHA1 309"1.3.14.3.2.7" => data.Slice(656, 5), // DES 310"1.3.132.0.34" => data.Slice(661, 5), // Secp384r1 311"1.3.132.0.35" => data.Slice(666, 5), // Secp521r1 312"2.5.4.3" => data.Slice(671, 3), // CommonName 313"2.5.4.5" => data.Slice(674, 3), // SerialNumber 314"2.5.4.6" => data.Slice(677, 3), // CountryOrRegionName 315"2.5.4.7" => data.Slice(680, 3), // Locality 316"2.5.4.8" => data.Slice(683, 3), // StateOrProvinceName 317"2.5.4.10" => data.Slice(686, 3), // OrganizationName 318"2.5.4.11" => data.Slice(689, 3), // OrganizationalUnit 319"2.5.4.97" => data.Slice(692, 3), // OrganizationIdentifier 320"2.5.29.14" => data.Slice(695, 3), // SubjectKeyIdentifier 321"2.5.29.15" => data.Slice(698, 3), // KeyUsage 322"2.5.29.17" => data.Slice(701, 3), // SubjectAlternativeName 323"2.5.29.19" => data.Slice(704, 3), // BasicConstraints 324"2.5.29.20" => data.Slice(707, 3), // CrlNumber 325"2.5.29.35" => data.Slice(710, 3), // AuthorityKeyIdentifier 326"2.16.840.1.101.3.4.1.2" => data.Slice(713, 9), // Aes128Cbc 327"2.16.840.1.101.3.4.1.22" => data.Slice(722, 9), // Aes192Cbc 328"2.16.840.1.101.3.4.1.42" => data.Slice(731, 9), // Aes256Cbc 329"2.16.840.1.101.3.4.2.1" => data.Slice(740, 9), // Sha256 330"2.16.840.1.101.3.4.2.2" => data.Slice(749, 9), // Sha384 331"2.16.840.1.101.3.4.2.3" => data.Slice(758, 9), // Sha512 332"2.16.840.1.101.3.4.3.17" => data.Slice(767, 9), // MLDsa44 333"2.16.840.1.101.3.4.3.18" => data.Slice(776, 9), // MLDsa65 334"2.16.840.1.101.3.4.3.19" => data.Slice(785, 9), // MLDsa87 335"2.16.840.1.101.3.4.4.1" => data.Slice(794, 9), // MlKem512 336"2.16.840.1.101.3.4.4.2" => data.Slice(803, 9), // MlKem768 337"2.16.840.1.101.3.4.4.3" => data.Slice(812, 9), // MlKem1024 338"2.23.140.1.2.1" => data.Slice(821, 6), // CabForumDV 339"2.23.140.1.2.2" => data.Slice(827, 6), // CabForumOV
System.Formats.Cbor (14)
System\Formats\Cbor\Reader\CborReader.Map.cs (3)
140ReadOnlySpan<byte> previousKeyEncoding = buffer.Slice(previousKeyEncodingRange.Offset, previousKeyEncodingRange.Length); 141ReadOnlySpan<byte> currentKeyEncoding = buffer.Slice(currentKeyEncodingRange.Offset, currentKeyEncodingRange.Length); 211return _reader._data.Span.Slice(range.Offset, range.Length);
System\Formats\Cbor\Reader\CborReader.String.cs (11)
45buffer.Slice(bytesRead, length).CopyTo(result); 86buffer.Slice(bytesRead, length).CopyTo(destination); 190ReadOnlySpan<byte> encodedString = buffer.Slice(bytesRead, length); 238ReadOnlySpan<byte> encodedSlice = buffer.Slice(bytesRead, byteLength); 342source.Slice(o, l).CopyTo(target); 367source.Slice(o, l).CopyTo(destination); 388concatenatedStringSize += ValidateUtf8AndGetCharCount(buffer.Slice(o, l), utf8Encoding); 405int charsWritten = input.utf8Encoding.GetChars(source.Slice(o, l), target); 423concatenatedStringSize += ValidateUtf8AndGetCharCount(buffer.Slice(o, l), utf8Encoding); 434int chunkCharsWritten = utf8Encoding.GetChars(buffer.Slice(o, l), destination); 501ReadOnlySpan<byte> encodedSlice = buffer.Slice(bytesRead, byteLength);
System.Formats.Nrbf (1)
System\Formats\Nrbf\NrbfDecoder.cs (1)
44&& bytes.Slice(SerializedStreamHeaderRecord.Size - HeaderSuffix.Length, HeaderSuffix.Length).SequenceEqual(HeaderSuffix);
System.Formats.Tar (33)
src\runtime\src\libraries\Common\src\System\IO\PathInternal.cs (2)
135sb.Append(path.Slice(0, skip)); 231path.Slice(0, path.Length - 1) :
System\Formats\Tar\TarHeader.Read.cs (22)
328ReadOnlySpan<byte> spanChecksum = buffer.Slice(FieldLocations.Checksum, FieldLengths.Checksum); 360long size = TarHelpers.ParseNumeric<long>(buffer.Slice(FieldLocations.Size, FieldLengths.Size)); 368name: TarHelpers.ParseUtf8String(buffer.Slice(FieldLocations.Name, FieldLengths.Name)), 369mode: TarHelpers.ParseNumeric<int>(buffer.Slice(FieldLocations.Mode, FieldLengths.Mode)), 370mTime: ParseAsTimestamp(buffer.Slice(FieldLocations.MTime, FieldLengths.MTime)), 375_uid = TarHelpers.ParseNumeric<int>(buffer.Slice(FieldLocations.Uid, FieldLengths.Uid)), 376_gid = TarHelpers.ParseNumeric<int>(buffer.Slice(FieldLocations.Gid, FieldLengths.Gid)), 377_linkName = TarHelpers.ParseUtf8String(buffer.Slice(FieldLocations.LinkName, FieldLengths.LinkName)) 415calculatedChecksum += Checksum(buffer.Slice(0, FieldLocations.Checksum)); 421calculatedChecksum += Checksum(buffer.Slice(FieldLocations.Checksum + FieldLengths.Checksum, TarHelpers.RecordSize - (FieldLocations.Checksum + FieldLengths.Checksum))); 430ReadOnlySpan<byte> magic = buffer.Slice(FieldLocations.Magic, FieldLengths.Magic); 469ReadOnlySpan<byte> version = buffer.Slice(FieldLocations.Version, FieldLengths.Version); 519_uName = TarHelpers.ParseUtf8String(buffer.Slice(FieldLocations.UName, FieldLengths.UName)); 520_gName = TarHelpers.ParseUtf8String(buffer.Slice(FieldLocations.GName, FieldLengths.GName)); 527_devMajor = TarHelpers.ParseNumeric<int>(buffer.Slice(FieldLocations.DevMajor, FieldLengths.DevMajor)); 530_devMinor = TarHelpers.ParseNumeric<int>(buffer.Slice(FieldLocations.DevMinor, FieldLengths.DevMinor)); 538_aTime = ParseAsTimestamp(buffer.Slice(FieldLocations.ATime, FieldLengths.ATime)); 540_cTime = ParseAsTimestamp(buffer.Slice(FieldLocations.CTime, FieldLengths.CTime)); 562_prefix = TarHelpers.ParseUtf8String(buffer.Slice(FieldLocations.Prefix, FieldLengths.Prefix)); 683ReadOnlySpan<byte> line = buffer.Slice(0, newlinePos); 693ReadOnlySpan<byte> length = buffer.Slice(0, spacePos); 709ReadOnlySpan<byte> keySlice = line.Slice(0, equalPos);
System\Formats\Tar\TarHeader.Write.cs (9)
381name = name.Slice(0, utf16NameTruncatedLength); 423prefix = pathNameBytes.Slice(0, lastIdx); 437prefix = pathNameBytes.Slice(0, lastIdx); 501linkName = linkName.Slice(0, truncatedLength); 559uName = uName.Slice(0, truncatedLength); 577gName = gName.Slice(0, truncatedLength); 787bytesToWrite = bytesToWrite.Slice(0, numToCopy); 804bytesToWrite = bytesToWrite.Slice(0, numToCopy); 833Vector<byte> vector = new Vector<byte>(bytes.Slice(i, vectorSize));
System.IO.Compression (28)
System\IO\Compression\WinZipAesStream.cs (1)
489buffer = buffer[bytesToProcess..];
System\IO\Compression\ZipBlocks.Async.cs (1)
208dynamicHeader = buffer.Span[FieldLocations.DynamicData..];
System\IO\Compression\ZipBlocks.cs (25)
56field._tag = BinaryPrimitives.ReadUInt16LittleEndian(bytes[FieldLocations.Tag..]); 57field._size = BinaryPrimitives.ReadUInt16LittleEndian(bytes[FieldLocations.Size..]); 65field._data = bytes.Slice(FieldLocations.DynamicData, field._size).ToArray(); 75while (TryReadBlock(extraFieldData[totalBytesConsumed..], out int currBytesConsumed, out ZipGenericExtraField field)) 85trailingExtraFieldData = extraFieldData[totalBytesConsumed..]; 788TryParseData(extraFieldData.Slice(0, fieldSize), out aesExtraField)) 825compressionMethod: BinaryPrimitives.ReadUInt16LittleEndian(data.Slice(5, 2)) 917VersionNeededToExtract = BinaryPrimitives.ReadUInt16LittleEndian(buffer[FieldLocations.VersionNeededToExtract..]), 918GeneralPurposeBitFlag = BinaryPrimitives.ReadUInt16LittleEndian(buffer[FieldLocations.GeneralPurposeBitFlags..]), 919CompressionMethod = BinaryPrimitives.ReadUInt16LittleEndian(buffer[FieldLocations.CompressionMethod..]), 920LastModified = BinaryPrimitives.ReadUInt32LittleEndian(buffer[FieldLocations.LastModified..]), 921Crc32 = BinaryPrimitives.ReadUInt32LittleEndian(buffer[FieldLocations.Crc32..]), 922FilenameLength = BinaryPrimitives.ReadUInt16LittleEndian(buffer[FieldLocations.FilenameLength..]), 923ExtraFieldLength = BinaryPrimitives.ReadUInt16LittleEndian(buffer[FieldLocations.ExtraFieldLength..]), 924FileCommentLength = BinaryPrimitives.ReadUInt16LittleEndian(buffer[FieldLocations.FileCommentLength..]), 925InternalFileAttributes = BinaryPrimitives.ReadUInt16LittleEndian(buffer[FieldLocations.InternalFileAttributes..]), 926ExternalFileAttributes = BinaryPrimitives.ReadUInt32LittleEndian(buffer[FieldLocations.ExternalFileAttributes..]) 929compressedSizeSmall = BinaryPrimitives.ReadUInt32LittleEndian(buffer[FieldLocations.CompressedSize..]); 930uncompressedSizeSmall = BinaryPrimitives.ReadUInt32LittleEndian(buffer[FieldLocations.UncompressedSize..]); 931diskNumberStartSmall = BinaryPrimitives.ReadUInt16LittleEndian(buffer[FieldLocations.DiskNumberStart..]); 932relativeOffsetOfLocalHeaderSmall = BinaryPrimitives.ReadUInt32LittleEndian(buffer[FieldLocations.RelativeOffsetOfLocalHeader..]); 946ReadOnlySpan<byte> zipExtraFields = dynamicHeader.Slice(header.FilenameLength, header.ExtraFieldLength); 975header.FileComment = dynamicHeader.Slice(header.FilenameLength + header.ExtraFieldLength, header.FileCommentLength).ToArray(); 1007dynamicHeader = buffer[FieldLocations.DynamicData..]; 1019buffer[FieldLocations.DynamicData..].CopyTo(collatedHeader);
System\IO\Compression\ZipCryptoStream.cs (1)
337buffer = buffer[chunkSize..];
System.IO.FileSystem.AccessControl (3)
src\runtime\src\libraries\Common\src\Interop\Windows\Kernel32\Interop.FormatMessage.cs (1)
85return buffer.Slice(0, length).ToString();
src\runtime\src\libraries\Common\src\System\IO\PathInternal.cs (2)
135sb.Append(path.Slice(0, skip)); 231path.Slice(0, path.Length - 1) :
System.IO.FileSystem.DriveInfo (4)
src\runtime\src\libraries\Common\src\Interop\Linux\procfs\Interop.ProcMountInfo.TryParseMountInfoLine.cs (4)
43ReadOnlySpan<char> root = line[fields.Current]; 50ReadOnlySpan<char> mountPoint = line[fields.Current]; 67ReadOnlySpan<char> fileSystemType = line[fields.Current]; 80ReadOnlySpan<char> superOptions = line[fields.Current];
System.IO.FileSystem.Watcher (2)
src\runtime\src\libraries\Common\src\System\IO\PathInternal.cs (2)
135sb.Append(path.Slice(0, skip)); 231path.Slice(0, path.Length - 1) :
System.IO.Hashing (8)
System\IO\Hashing\Adler32.cs (1)
226foreach (byte b in source.Slice(0, k))
System\IO\Hashing\XxHash32.cs (1)
99source.Slice(0, remain).CopyTo(_holdback.AsSpan(held));
System\IO\Hashing\XxHash32.State.cs (1)
40source = source.Slice(0, StripeSize);
System\IO\Hashing\XxHash64.cs (1)
99source.Slice(0, remain).CopyTo(_holdback.AsSpan(held));
System\IO\Hashing\XxHash64.State.cs (1)
51source = source.Slice(0, StripeSize);
System\IO\Hashing\XxHashShared.cs (3)
267source.Slice(0, loadSize).CopyTo(new Span<byte>(buffer + state.BufferedCount, loadSize)); 306source.Slice(sourceIndex - StripeLengthBytes, StripeLengthBytes).CopyTo(new Span<byte>(buffer + InternalBufferLengthBytes - StripeLengthBytes, StripeLengthBytes)); 319source.Slice(sourceIndex - StripeLengthBytes, StripeLengthBytes).CopyTo(new Span<byte>(buffer + InternalBufferLengthBytes - StripeLengthBytes, StripeLengthBytes));
System.IO.Packaging (4)
System\IO\Packaging\ContentType.cs (3)
293_type = ValidateToken(typeAndSubType.Slice(0, forwardSlashPos).ToString()); 336ValidateToken(parameterAndValue.Slice(0, equalSignIndex).ToString()), 337ValidateQuotedStringOrToken(parameterAndValue.Slice(parameterStartIndex, parameterValueLength).ToString()));
System\IO\Packaging\InterleavedZipPackagePartStream.cs (1)
357pieceStream.Write(buffer.Slice(totalBytesWritten, numBytesToWriteInCurrentPiece));
System.IO.Pipelines (1)
System\IO\Pipelines\Pipe.cs (1)
1216source.Slice(0, writable).CopyTo(destination);
System.Linq (5)
System\Linq\SegmentedArrayBuilder.cs (3)
71foreach (T[] segment in segments.Slice(0, segmentsCount)) 145ReadOnlySpan<T> sourceSlice = sourceSpan.Slice(0, Math.Min(availableSpaceInCurrentSpan, sourceSpan.Length)); 318foreach (T[] arr in ((ReadOnlySpan<T[]>)_segments).Slice(0, segmentsCount))
System\Linq\SkipTake.SpeedOpt.cs (2)
153sourceSpan.Slice(sourceIndex, destination.Length).CopyTo(destination); 176return span.Slice(minInclusive, GetAdjustedCount(minInclusive, _maxIndexInclusive, span.Length)).IndexOf(item);
System.Memory (14)
System\Buffers\BuffersExtensions.cs (1)
138input.Slice(0, writeSize).CopyTo(destination);
System\Buffers\ReadOnlySequence.Helpers.cs (4)
189return span.Slice(startIndex, endIndex - startIndex); 213return span.Slice(startIndex, (endIndex & ReadOnlySequence.IndexBitMask) - startIndex); 224return memory.Span.Slice(startIndex & ReadOnlySequence.IndexBitMask, endIndex - startIndex); 656first = first.Slice(startIndex, endIndex - startIndex);
System\Buffers\SequenceReader.cs (2)
419firstSpan.Slice(0, destination.Length).CopyTo(destination); 445nextSpan.Slice(0, toCopy).CopyTo(destination.Slice(copied));
System\Buffers\SequenceReader.Search.cs (5)
25span = index == 0 ? default : remaining.Slice(0, index); 61span = remaining.Slice(0, index); 337span = remaining.Slice(0, index); 422span = remaining.Slice(0, index); 841currentSpan = currentSpan.Slice(0, next.Length);
System\Text\EncodingExtensions.cs (2)
434: encoder.GetByteCount(chars.Slice(0, MaxInputElementsPerIteration), flush: false /* this isn't the end of the data */); 527: decoder.GetCharCount(bytes.Slice(0, MaxInputElementsPerIteration), flush: false /* this isn't the end of the data */);
System.Net.Http (37)
src\runtime\src\libraries\Common\src\System\Net\Http\aspnetcore\Http2\Hpack\HPackDecoder.cs (5)
198ReadOnlySpan<byte> headerBytes = data.Slice(_headerNameRange.GetValueOrDefault().start, _headerNameRange.GetValueOrDefault().length); 448data.Slice(currentIndex, count).CopyTo(_stringOctets.AsSpan(_stringIndex)); 479data.Slice(currentIndex, count).CopyTo(_stringOctets.AsSpan(_stringIndex)); 508: data.Slice(_headerValueRange.GetValueOrDefault().start, _headerValueRange.GetValueOrDefault().length); 523: data.Slice(_headerNameRange.GetValueOrDefault().start, _headerNameRange.GetValueOrDefault().length);
src\runtime\src\libraries\Common\src\System\Net\Http\aspnetcore\Http3\QPack\QPackDecoder.cs (5)
249ReadOnlySpan<byte> headerBytes = data.Slice(_headerNameRange.GetValueOrDefault().start, _headerNameRange.GetValueOrDefault().length); 310data.Slice(currentIndex, count).CopyTo(_stringOctets.AsSpan(_stringIndex)); 394data.Slice(currentIndex, count).CopyTo(_stringOctets.AsSpan(_stringIndex)); 595: data.Slice(_headerValueRange.GetValueOrDefault().start, _headerValueRange.GetValueOrDefault().length); 605: data.Slice(_headerNameRange.GetValueOrDefault().start, _headerNameRange.GetValueOrDefault().length);
src\runtime\src\libraries\Common\src\System\Net\MultiArrayBuffer.cs (1)
419source.Slice(0, block.Length).CopyTo(block.Span);
System\Net\Http\FormUrlEncodedContent.cs (1)
77builder.Append(escapedChars.Slice(0, indexOfEscapedSpace));
System\Net\Http\Headers\AltSvcHeaderParser.cs (3)
259builder.Append(value.Slice(0, idx)); 328else if (!TryReadQuotedValue(quoted.Slice(0, idx), out host)) 368builder.Append(value.Slice(0, idx));
System\Net\Http\Headers\ContentDispositionHeaderValue.cs (4)
289dateString = dateString.Slice(1, dateString.Length - 2); 461processedInputSpan[parts[0]] is not "\"=" || 462processedInputSpan[parts[4]] is not "=\"" || 463!processedInputSpan[parts[2]].Equals("b", StringComparison.OrdinalIgnoreCase))
System\Net\Http\Headers\HeaderUtilities.cs (2)
85Encoding.ASCII.GetChars(utf8.Slice(0, length), builder.AppendSpan(length)); 100foreach (byte b in utf8.Slice(0, length))
System\Net\Http\HttpContent.cs (2)
179return encoding.GetString(firstBuffer[bomLength..]); 1014buffer.Slice(0, remainingInCurrentBuffer.Length).CopyTo(remainingInCurrentBuffer);
System\Net\Http\HttpRuleParser.cs (1)
166slice = slice.Slice(0, index);
System\Net\Http\SocketsHttpHandler\AuthenticationHelper.Digest.cs (1)
431sb.Append(valueSpan.Slice(0, i)).Append('\\').Append(valueSpan[i]);
System\Net\Http\SocketsHttpHandler\Http2Connection.cs (2)
732frameData = frameData.Slice(0, frameData.Length - padLength); 771if ((frameHeader.StreamId != 0 && originLength == 0) || (frameHeader.StreamId == 0 && span.Length >= originLength && span.Slice(0, originLength).SequenceEqual(_pool.Http2AltSvcOriginUri)))
System\Net\Http\SocketsHttpHandler\HttpConnection.cs (7)
1229throw new HttpRequestException(HttpRequestError.InvalidResponse, SR.Format(SR.net_http_invalid_response_header_line, Encoding.ASCII.GetString(buffer.Slice(0, newLineIndex)))); 1247name = name.Slice(0, spIdx); 1273value = value.Slice(0, spIdx); 1398WriteToBuffer(source.Slice(0, remaining)); 1429WriteToBuffer(source.Span.Slice(0, remaining)); 1618line = buffer.Slice(0, length); 1754available.Slice(0, toCopy).CopyTo(buffer);
System\Net\Http\SocketsHttpHandler\HttpEnvironmentProxy.cs (2)
239uri = new Uri($"{uriSpan[tokens[0]]}//:@{uriSpan[tokens[2]]}");
System\Net\Http\SocketsHttpHandler\MultiProxy.cs (1)
261if ((proxyType & wantedFlag) != 0 && Uri.TryCreate(string.Concat("http://", proxyString.Slice(0, iter)), UriKind.Absolute, out uri))
System.Net.Http.WinHttpHandler (2)
src\runtime\src\libraries\Common\src\Interop\Windows\Kernel32\Interop.FormatMessage.cs (1)
85return buffer.Slice(0, length).ToString();
System\Net\Http\WinHttpRequestCallback.cs (1)
342AddressFamily.InterNetworkV6 => new IPAddress(remoteAddressSpan.Slice(8, 16).ToArray()),
System.Net.HttpListener (3)
src\runtime\src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.DumpBuffer.cs (1)
35Log.DumpBuffer(IdOf(thisOrContextObject), memberName, buffer.Slice(0, Math.Min(buffer.Length, MaxDumpSize)).ToArray());
System\Net\Managed\ChunkStream.cs (1)
310return idx >= 0 ? input.Slice(0, idx) : input;
System\Net\Managed\HttpListenerRequest.Managed.cs (1)
166host = host.Slice(0, colon);
System.Net.Mail (4)
System\Net\Mime\MediaTypeMap.cs (1)
858mediaType = mediaType.Slice(0, pos);
System\Net\Mime\MimeBasePart.cs (2)
103valueSpan[subStrings[0]] is not "=" || 104valueSpan[subStrings[4]] is not "=")
System\Net\Mime\SmtpDateTime.cs (1)
279timeZoneSpan = timeZoneSpan.Slice(0, endOfTimeZoneOffset);
System.Net.NameResolution (1)
System\Net\Dns.cs (1)
445hostSpan = hostSpan.Slice(0, hostSpan.Length - 1);
System.Net.NetworkInformation (17)
System\Net\NetworkInformation\StringParsingHelpers.Statistics.cs (17)
423if (!lineSpan[pieces[0]].SequenceEqual(name)) 431BytesReceived = ParseUInt64AndClampToInt64(lineSpan[pieces[1]]), 432PacketsReceived = ParseUInt64AndClampToInt64(lineSpan[pieces[2]]), 433ErrorsReceived = ParseUInt64AndClampToInt64(lineSpan[pieces[3]]), 434IncomingPacketsDropped = ParseUInt64AndClampToInt64(lineSpan[pieces[4]]), 435FifoBufferErrorsReceived = ParseUInt64AndClampToInt64(lineSpan[pieces[5]]), 436PacketFramingErrorsReceived = ParseUInt64AndClampToInt64(lineSpan[pieces[6]]), 437CompressedPacketsReceived = ParseUInt64AndClampToInt64(lineSpan[pieces[7]]), 438MulticastFramesReceived = ParseUInt64AndClampToInt64(lineSpan[pieces[8]]), 440BytesTransmitted = ParseUInt64AndClampToInt64(lineSpan[pieces[9]]), 441PacketsTransmitted = ParseUInt64AndClampToInt64(lineSpan[pieces[10]]), 442ErrorsTransmitted = ParseUInt64AndClampToInt64(lineSpan[pieces[11]]), 443OutgoingPacketsDropped = ParseUInt64AndClampToInt64(lineSpan[pieces[12]]), 444FifoBufferErrorsTransmitted = ParseUInt64AndClampToInt64(lineSpan[pieces[13]]), 445CollisionsDetected = ParseUInt64AndClampToInt64(lineSpan[pieces[14]]), 446CarrierLosses = ParseUInt64AndClampToInt64(lineSpan[pieces[15]]), 447CompressedPacketsTransmitted = ParseUInt64AndClampToInt64(lineSpan[pieces[16]]),
System.Net.Primitives (6)
src\runtime\src\libraries\Common\src\System\Net\IPv6AddressHelper.Common.cs (2)
249if (!IPv4AddressHelper.IsValid(name.Slice(lastSequence, end - lastSequence), out int seqEnd, true, false, false)) 346scopeId = address.Slice(scopeStart, i - scopeStart);
System\Net\IPEndPoint.cs (2)
115else if (s.Slice(0, lastColonPos).LastIndexOf(TChar.CreateTruncating(':')) == -1) 121IPAddress? address = IPAddressParser.Parse(s.Slice(0, addressLength), true);
System\Net\IPNetwork.cs (2)
184ReadOnlySpan<char> ipAddressSpan = s.Slice(0, separatorIndex); 212ReadOnlySpan<byte> ipAddressSpan = utf8Text.Slice(0, separatorIndex);
System.Net.Quic (4)
src\runtime\src\libraries\Common\src\System\Net\IPv6AddressHelper.Common.cs (2)
249if (!IPv4AddressHelper.IsValid(name.Slice(lastSequence, end - lastSequence), out int seqEnd, true, false, false)) 346scopeId = address.Slice(scopeStart, i - scopeStart);
src\runtime\src\libraries\Common\src\System\Net\MultiArrayBuffer.cs (1)
419source.Slice(0, block.Length).CopyTo(block.Span);
src\runtime\src\libraries\Common\src\System\Net\StreamBuffer.cs (1)
115_buffer.AvailableMemory.CopyFrom(buffer.Slice(0, bytesWritten));
System.Net.Requests (8)
System\Net\FtpControlStream.cs (8)
929ReadOnlySpan<char> dateTimeLine = strSpan[parts[1]]; 934int year = int.Parse(dateTimeLine.Slice(0, 4), NumberFormatInfo.InvariantInfo); 935int month = short.Parse(dateTimeLine.Slice(4, 2), NumberFormatInfo.InvariantInfo); 936int day = short.Parse(dateTimeLine.Slice(6, 2), NumberFormatInfo.InvariantInfo); 937int hour = short.Parse(dateTimeLine.Slice(8, 2), NumberFormatInfo.InvariantInfo); 938int minute = short.Parse(dateTimeLine.Slice(10, 2), NumberFormatInfo.InvariantInfo); 939int second = short.Parse(dateTimeLine.Slice(12, 2), NumberFormatInfo.InvariantInfo); 943millisecond = short.Parse(strSpan[parts[2]], NumberFormatInfo.InvariantInfo);
System.Net.Security (23)
src\runtime\src\libraries\Common\src\System\Net\IPv6AddressHelper.Common.cs (2)
249if (!IPv4AddressHelper.IsValid(name.Slice(lastSequence, end - lastSequence), out int seqEnd, true, false, false)) 346scopeId = address.Slice(scopeStart, i - scopeStart);
src\runtime\src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.DumpBuffer.cs (1)
35Log.DumpBuffer(IdOf(thisOrContextObject), memberName, buffer.Slice(0, Math.Min(buffer.Length, MaxDumpSize)).ToArray());
src\runtime\src\libraries\Common\src\System\Net\Security\MD4.cs (1)
116input.Slice(0, partLen).CopyTo(buffer.Slice(index));
src\runtime\src\libraries\Common\src\System\Text\UrlBase64Encoding.cs (1)
47source.Slice(0, pos).CopyTo(dest);
System\Net\NegotiateAuthenticationPal.ManagedNtlm.cs (7)
386return payload.Slice(offset, length); 555time = DateTime.FromFileTimeUtc(BinaryPrimitives.ReadInt64LittleEndian(info.Slice(4, 8))); 573info.Slice(0, length + 4).CopyTo(targetInfoBuffer.AsSpan(targetInfoOffset, length + 4)); 638ref readonly ChallengeMessage challengeMessage = ref MemoryMarshal.AsRef<ChallengeMessage>(blob.Slice(0, sizeof(ChallengeMessage))); 642!NtlmHeader.SequenceEqual(blob.Slice(0, NtlmHeader.Length))) 724ReadOnlySpan<byte> serverChallenge = blob.Slice(24, 8); 872if (!VerifyMIC(output.Slice(0, input.Length - SignatureLength), input.Slice(0, SignatureLength)))
System\Net\NegotiateAuthenticationPal.Unix.cs (1)
531tokenBytes = tokenBytes.Slice(0, length - 1);
System\Net\Security\SslStream.IO.cs (1)
587ProtocolToken token = NextMessage(availableData.Slice(0, chunkSize), out int consumed);
System\Net\Security\TlsFrameHelper.cs (5)
406TryParseClientHello(helloData.Slice(0, helloLength), ref info, options, callback) : 407TryParseServerHello(helloData.Slice(0, helloLength), ref info, options, callback); 518ReadOnlySpan<byte> extensionData = extensions.Slice(0, extensionLength); 586ReadOnlySpan<byte> serverName = serverNameList.Slice(0, serverNameListLength); 725ReadOnlySpan<byte> protocol = alpnList.Slice(1, protocolLength);
System\Net\Security\TlsSession.cs (3)
929_clientHelloBytesBuffered = input.Slice(0, frameLength).ToArray(); 1172plaintext.Slice(0, chunk).CopyTo(rented); 1259ciphertext.Slice(0, frameSize).CopyTo(_decryptScratch);
System\Security\Authentication\ExtendedProtection\ServiceNameCollection.cs (1)
210host = hostAndPort.Slice(0, colonIndex); // Excludes colon
System.Net.ServerSentEvents (2)
System\Net\ServerSentEvents\SseFormatter.cs (1)
158ReadOnlySpan<byte> nextLine = data.Slice(0, lineLength);
System\Net\ServerSentEvents\SseParser_1.cs (1)
360fieldName = line.Slice(0, colonPos);
System.Net.Sockets (1)
src\runtime\src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.DumpBuffer.cs (1)
35Log.DumpBuffer(IdOf(thisOrContextObject), memberName, buffer.Slice(0, Math.Min(buffer.Length, MaxDumpSize)).ToArray());
System.Net.WebClient (1)
src\runtime\src\libraries\Common\src\System\IO\ChunkedMemoryStream.cs (1)
51buffer.Slice(0, toCopy).CopyTo(new Span<byte>(_currentChunk._buffer, _currentChunk._freeOffset, toCopy));
System.Net.WebHeaderCollection (1)
System\Net\HeaderInfoTable.cs (1)
77return lastElement.Slice(0, equalsPos).Trim().Equals("Expires", StringComparison.OrdinalIgnoreCase);
System.Numerics.Tensors (15)
System\Numerics\Tensors\netcore\ReadOnlyTensorDimensionSpan_1.cs (2)
30_sliceShape = TensorShape.Create((dimension != tensor.Rank) ? tensor.Lengths[dimension..] : [1], tensor.Strides[dimension..], tensor.IsPinned);
System\Numerics\Tensors\netcore\Tensor.cs (8)
1618span.Slice(0, ospan.Length).CopyTo(ospan); 1678span.Slice(0, ospan.Length).CopyTo(ospan); 2414tensor.Lengths.Slice(0, dimension).CopyTo(newLengths); 2426tensor.Strides.Slice(0, dimension).CopyTo(newStrides); 2451tensor.Lengths.Slice(0, dimension).CopyTo(newLengths); 2463tensor.Strides.Slice(0, dimension).CopyTo(newStrides); 2488tensor.Lengths.Slice(0, dimension).CopyTo(newLengths); 2500tensor.Strides.Slice(0, dimension).CopyTo(newStrides);
System\Numerics\Tensors\netcore\TensorDimensionSpan_1.cs (2)
30_sliceShape = TensorShape.Create((dimension != tensor.Rank) ? tensor.Lengths[dimension..] : [1], tensor.Strides[dimension..], tensor.IsPinned);
System\Numerics\Tensors\netcore\TensorShape.cs (3)
593ReadOnlySpan<nint> lengths1 = shape1.Lengths[rankDelta..]; 623ReadOnlySpan<nint> strides1 = shape1.Strides[rankDelta..]; 664ReadOnlySpan<nint> lengths1 = shape1Lengths[rankDelta..];
System.Private.CoreLib (155)
Internal\Runtime\CompilerHelpers\InteropHelpers.cs (1)
75managed.Slice(0, numChars).CopyTo(native);
src\runtime\src\libraries\Common\src\Interop\Linux\procfs\Interop.ProcFsStat.TryReadStatusFile.cs (1)
88switch (line.Slice(0, startIndex)) // name
src\runtime\src\libraries\Common\src\Interop\Linux\procfs\Interop.ProcMountInfo.TryParseMountInfoLine.cs (4)
43ReadOnlySpan<char> root = line[fields.Current]; 50ReadOnlySpan<char> mountPoint = line[fields.Current]; 67ReadOnlySpan<char> fileSystemType = line[fields.Current]; 80ReadOnlySpan<char> superOptions = line[fields.Current];
src\runtime\src\libraries\Common\src\System\IO\PathInternal.cs (2)
135sb.Append(path.Slice(0, skip)); 231path.Slice(0, path.Length - 1) :
src\runtime\src\libraries\Common\src\System\Reflection\AssemblyNameParser.cs (1)
266attributeValueSpan[parts[i]],
src\runtime\src\libraries\System.Private.CoreLib\src\System\Boolean.cs (1)
314return value.Slice(start, end - start + 1);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Utf8Parser\Utf8Parser.Guid.cs (4)
63if (!TryParseUInt32X(text.Slice(0, 8), out uint i1, out int justConsumed) || justConsumed != 8) 70if (!TryParseUInt16X(text.Slice(8, 4), out ushort i2, out justConsumed) || justConsumed != 4) 77if (!TryParseUInt16X(text.Slice(12, 4), out ushort i3, out justConsumed) || justConsumed != 4) 84if (!TryParseUInt16X(text.Slice(16, 4), out ushort i4, out justConsumed) || justConsumed != 4)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Utf8Parser\Utf8Parser.Number.cs (2)
114source.Slice(startIndexNonLeadingDigitsBeforeDecimal, numNonLeadingDigitsBeforeDecimalToCopy).CopyTo(digits); 178source.Slice(startIndexOfDigitsAfterDecimalToCopy, numDigitsAfterDecimalToCopy).CopyTo(digits.Slice(dstIndex));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Byte.cs (1)
342if ((source.Length > sizeof(byte)) && (source[sizeof(byte)..].ContainsAnyExcept((byte)0x00)))
src\runtime\src\libraries\System.Private.CoreLib\src\System\Char.cs (1)
1304if ((source.Length > sizeof(char)) && (source[sizeof(char)..].ContainsAnyExcept((byte)0x00)))
src\runtime\src\libraries\System.Private.CoreLib\src\System\Convert.cs (5)
2463OperationStatus status = Base64.EncodeToChars(source.Slice(0, chunkSize), destination.Slice(writeOffset), out int bytesConsumed, out int charsWritten); 2673source = source.Slice(0, destination.Length * 2); 2681source = source.Slice(0, source.Length - 1); 2729utf8Source = utf8Source.Slice(0, destination.Length * 2); 2737utf8Source = utf8Source.Slice(0, utf8Source.Length - 1);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Decimal.cs (1)
634span = span.Slice(0, 16);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventPipePayloadDecoder.cs (2)
95decodedFields[i] = new Guid(payload.Slice(0, sizeOfGuid)); 126charPayload = MemoryMarshal.Cast<byte, char>(payload.Slice(0, byteCount - 2));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Enum.cs (1)
1069subvalue = value.Slice(0, endIndex).Trim();
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\CompareInfo.Icu.cs (1)
198: source.Slice(0, startIndex);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\CultureData.Icu.cs (1)
329span = span.Slice(0, span.IndexOf('\0'));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\DateTimeFormatInfo.cs (1)
2361Culture.CompareInfo.Compare(str.Value.Slice(str.Index, value.tokenString.Length), value.tokenString, CompareOptions.IgnoreCase) == 0))
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\DateTimeParse.cs (7)
426if (str.CompareInfo.Compare(str.Value.Slice(str.Index, target.Length), target, CompareOptions.IgnoreCase) != 0) 5686m_info.Compare(Value.Slice(Index, target.Length), target, CompareOptions.IgnoreCase) == 0; 5693if (matchLength > valueRemaining || m_info.Compare(Value.Slice(Index, matchLength), target, CompareOptions.IgnoreCase) != 0) 5725if (m_info.CompareOptionIgnoreCase(Value.Slice(thisPosition, segmentLength), target.AsSpan(targetPosition, segmentLength)) != 0) 5758if (m_info.CompareOptionIgnoreCase(Value.Slice(thisPosition, segmentLength), target.AsSpan(targetPosition, segmentLength)) != 0) 5953Value = Value.Slice(0, i + 1); 5978Value.Slice(0, i).CopyTo(result);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\IcuLocaleData.cs (5)
3708indices = indices[start..end]; 3727return GetString(CultureNames.Slice(start, length)); 3751ReadOnlySpan<byte> numericData = NameIndexToNumericData.Slice(index * NumericLocaleDataBytesPerRow, NumericLocaleDataBytesPerRow); 3780return GetString(ThreeLetterWindowsLanguageName.Slice(index * 3, 3)); 3858return CultureNames.Slice(start, length);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\InvariantModeCasing.cs (2)
59src.Slice(0, i).CopyTo(destination); 105src.Slice(0, i).CopyTo(destination);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\JapaneseCalendar.Nls.cs (7)
175if (!int.TryParse(valueSpan.Slice(0, 4), NumberStyles.None, NumberFormatInfo.InvariantInfo, out int year) || 176!int.TryParse(valueSpan.Slice(5, 2), NumberStyles.None, NumberFormatInfo.InvariantInfo, out int month) || 177!int.TryParse(valueSpan.Slice(8, 2), NumberStyles.None, NumberFormatInfo.InvariantInfo, out int day)) 196ReadOnlySpan<char> eraName = dataSpan[names[0]]; 197ReadOnlySpan<char> abbreviatedEraName = dataSpan[names[1]]; 198ReadOnlySpan<char> englishEraName = dataSpan[names[2]]; 199ReadOnlySpan<char> abbreviatedEnglishEraName = dataSpan[names[3]];
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\Ordinal.Utf8.cs (4)
83else if (!spanA.Slice(0, bytesConsumedA).SequenceEqual(spanB.Slice(0, bytesConsumedB))) 393else if (!spanA.Slice(0, bytesConsumedA).SequenceEqual(spanB.Slice(0, bytesConsumedB)))
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\TimeSpanParse.cs (1)
255return new TimeSpanToken(TTT.Sep, 0, 0, _value.Slice(startPos, length));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Guid.cs (16)
517return TryParseExactD(guidString.Slice(1, 36), ref result); 577guidString = guidString.Slice(0, 36); 579if (TryParseHex(guidString.Slice(0, 8), out result._a) && // _a 580TryParseHex(guidString.Slice(9, 4), out uint uintTmp)) // _b 583if (TryParseHex(guidString.Slice(14, 4), out uintTmp)) // _c 586if (TryParseHex(guidString.Slice(19, 4), out uintTmp)) // _d, _e 589if (TryParseHex(guidString.Slice(24, 4), out uintTmp)) // _f, _g 594if (Number.TryParseBinaryIntegerHexOrBinaryNumberStyle<TChar, uint, Number.HexParser<uint>>(guidString.Slice(28, 8), NumberStyles.AllowHexSpecifier, out uintTmp, out _) == Number.ParsingStatus.OK) // _h, _i, _j, _k 661return TryParseExactD(guidString.Slice(1, 36), ref result); 705if (!TryParseHex(guidString.Slice(numStart, numLen), out result._a, ref overflow) || overflow) 727if (!TryParseHex(guidString.Slice(numStart, numLen), out result._b, ref overflow) || overflow) 749if (!TryParseHex(guidString.Slice(numStart, numLen), out result._c, ref overflow) || overflow) 797if (!TryParseHex(guidString.Slice(numStart, numLen), out uint byteVal, ref overflow) || overflow || byteVal > byte.MaxValue) 916charSpan.Slice(0, i).CopyTo(chArr); 967srcUtf8Span.Slice(0, i).CopyTo(destUtf8Span); 981srcUtf8Span.Slice(i, bytesConsumed).CopyTo(destUtf8Span.Slice(newLength));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Int128.cs (1)
854if (source[Size..].ContainsAnyExcept((byte)sign))
src\runtime\src\libraries\System.Private.CoreLib\src\System\Int16.cs (1)
395if (source[sizeof(short)..].ContainsAnyExcept((byte)sign))
src\runtime\src\libraries\System.Private.CoreLib\src\System\Int32.cs (1)
423if (source[sizeof(int)..].ContainsAnyExcept((byte)sign))
src\runtime\src\libraries\System.Private.CoreLib\src\System\Int64.cs (1)
420if (source[sizeof(long)..].ContainsAnyExcept((byte)sign))
src\runtime\src\libraries\System.Private.CoreLib\src\System\IntPtr.cs (1)
449if (source[sizeof(nint_t)..].ContainsAnyExcept((byte)sign))
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\BufferedStream.cs (1)
787buffer.Slice(0, bytesToWrite).CopyTo(new Span<byte>(_buffer, _writePos, bytesToWrite));
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\Enumeration\FileSystemName.cs (1)
425vsb.Append(span.Slice(0, i));
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\File.cs (1)
1589ReadOnlySpan<char> toEncode = contents.Slice(0, Math.Min(contents.Length, ChunkSize));
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\Path.cs (3)
155return end >= 0 ? path.Slice(0, end) : ReadOnlySpan<char>.Empty; 205return path.Slice(i, length - i); 272fileName.Slice(0, lastPeriod);
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\ReadOnlyMemoryStream.cs (1)
119_memory.Span.Slice(_position, bytesToRead).CopyTo(buffer);
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\Strategies\BufferedFileStreamStrategy.cs (2)
508source.Slice(0, numBytes).CopyTo(_buffer!.AsSpan(_writePos)); 710source.Span.Slice(0, spaceLeft).CopyTo(_buffer.AsSpan(_writePos));
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\StreamReader.cs (2)
822retVal = new string(charBufferSpan.Slice(0, idxOfNewline)); 826retVal = string.Concat(vsb.AsSpan(), charBufferSpan.Slice(0, idxOfNewline));
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\StreamWriter.cs (1)
791source.Span.Slice(copied, n).CopyTo(new Span<char>(_charBuffer, _charPos, n));
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\StringStream.cs (1)
162GetEncoder().Convert(remaining.Slice(0, charsToEncode), _pendingBytes, flush: false, out int charsUsed, out int bytesUsed, out _);
src\runtime\src\libraries\System.Private.CoreLib\src\System\MemoryExtensions.cs (4)
2592pos = span.Slice(0, pos).LastIndexOf(value[0], comparer); 3615SequenceEqual(span.Slice(0, value.Length), value, comparer); 5015other = other.Slice(0, span.Length); 5018span = span.Slice(0, other.Length);
src\runtime\src\libraries\System.Private.CoreLib\src\System\MemoryExtensions.Trim.cs (9)
106return span.Slice(start, length); 123=> span.Slice(0, ClampEnd(span, 0, trimElement)); 414return span.Slice(start, length); 458return span.Slice(0, ClampEnd(span, 0, trimElements)); 600return span.Slice(start, end - start + 1); 637return span.Slice(0, end + 1); 665return span.Slice(start, end - start + 1); 703return span.Slice(0, end + 1); 779return span.Slice(0, end + 1);
src\runtime\src\libraries\System.Private.CoreLib\src\System\MemoryExtensions.Trim.Utf8.cs (3)
29span = span[bytesConsumed..]; 54span = span[firstBytesConsumed..]; 80span = span[bytesConsumed..];
src\runtime\src\libraries\System.Private.CoreLib\src\System\Net\WebUtility.cs (7)
42sb.Append(valueSpan.Slice(0, index)); 71sb.Append(valueSpan.Slice(0, index)); 171sb.Append(valueSpan.Slice(0, index)); 196sb.Append(valueSpan.Slice(0, index)); 227? uint.TryParse(inputSlice.Slice(2, entityLength - 2), NumberStyles.AllowHexSpecifier, CultureInfo.InvariantCulture, out uint parsedValue) 228: uint.TryParse(inputSlice.Slice(1, entityLength - 1), NumberStyles.Integer, CultureInfo.InvariantCulture, out parsedValue); 251ReadOnlySpan<char> entity = inputSlice.Slice(0, entityLength);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Number.Parsing.cs (1)
1183if (!symbol.IsEmpty && symbol.Length <= candidate.Length && SpanEqualsOrdinalIgnoreCase(candidate.Slice(0, symbol.Length), symbol))
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\TotalOrderIeee754Comparer.cs (1)
151int suffixComparison = longer[extra.Length..].SequenceCompareTo(shorter);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Reflection\AssemblyName.cs (1)
367vsb.Append(stringToEscape.Slice(0, charsToCopy));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\Versioning\FrameworkName.cs (3)
127_identifier = frameworkNameSpan[components[0]].Trim().ToString(); 143ReadOnlySpan<char> component = frameworkNameSpan[components[i]]; 152ReadOnlySpan<char> key = component.Slice(0, separatorIndex).Trim();
src\runtime\src\libraries\System.Private.CoreLib\src\System\SByte.cs (1)
385if (source[sizeof(sbyte)..].ContainsAnyExcept((byte)sign))
src\runtime\src\libraries\System.Private.CoreLib\src\System\SearchValues\ProbabilisticWithAsciiCharSearchValues.cs (2)
181span = span.Slice(0, offset + 1); 209span = span.Slice(0, offset + 1);
src\runtime\src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\Helpers\AhoCorasick.cs (1)
268Ordinal.ToUpperOrdinal(span.Slice(i, i + 1 == span.Length ? 1 : 2), destination);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Security\SecurityElement.cs (1)
334sb.Append(span.Slice(0, pos)).Append(GetEscapeSequence(span[pos]));
src\runtime\src\libraries\System.Private.CoreLib\src\System\String.Manipulation.cs (4)
1262result.Append(searchSpace.Slice(0, index)); 1578builder.Append(remaining.Slice(0, idx)); 1668builder.Append(remaining.Slice(0, idx)); 2466if (currentSepLength == 1 || source.Slice(i, currentSepLength).SequenceEqual(separator))
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\CompositeFormat.cs (2)
145vsb.Append(remainder.Slice(0, countUntilNextBrace)); 312itemFormat = format.Slice(startingPos, pos - startingPos).ToString();
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\DecoderFallback.cs (2)
210return (Fallback(remainingBytes.Slice(0, fallbackLength).ToArray(), index: _originalByteCount - remainingBytes.Length)) 217if (Fallback(remainingBytes.Slice(0, fallbackLength).ToArray(), index: _originalByteCount - remainingBytes.Length))
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\DecoderNLS.cs (1)
207MemoryMarshal.AsBytes(new ReadOnlySpan<int>(in _leftoverBytes)).Slice(0, _leftoverByteCount);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\SpanLineEnumerator.cs (1)
66_current = remaining.Slice(0, idx);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\StringBuilder.cs (2)
1605Append(remainder.Slice(0, countUntilNextBrace)); 2090if (!chunk.EqualsOrdinal(span.Slice(span.Length - offset, chunk_length)))
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\ValueStringBuilder.AppendFormat.cs (1)
50Append(remainder.Slice(0, countUntilNextBrace));
src\runtime\src\libraries\System.Private.CoreLib\src\System\TimeZoneInfo.Unix.cs (3)
987if (int.TryParse(dateRule.Slice(1, monthWeekDotIndex - 1), out month) && 988int.TryParse(weekDaySpan.Slice(0, weekDayDotIndex), out week) && 1106return posixFormat.Slice(startIndex, index - startIndex);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Type.Helpers.cs (1)
541str = str.Slice(0, str.Length - 1);
src\runtime\src\libraries\System.Private.CoreLib\src\System\UInt128.cs (1)
1167if ((source.Length > Size) && (source[Size..].ContainsAnyExcept((byte)0x00)))
src\runtime\src\libraries\System.Private.CoreLib\src\System\UInt16.cs (1)
347if ((source.Length > sizeof(ushort)) && (source[sizeof(ushort)..].ContainsAnyExcept((byte)0x00)))
src\runtime\src\libraries\System.Private.CoreLib\src\System\UInt32.cs (1)
401if ((source.Length > sizeof(uint)) && (source[sizeof(uint)..].ContainsAnyExcept((byte)0x00)))
src\runtime\src\libraries\System.Private.CoreLib\src\System\UInt64.cs (1)
408if ((source.Length > sizeof(ulong)) && (source[sizeof(ulong)..].ContainsAnyExcept((byte)0x00)))
src\runtime\src\libraries\System.Private.CoreLib\src\System\UIntPtr.cs (1)
409if ((source.Length > sizeof(nuint_t)) && (source[sizeof(nuint_t)..].ContainsAnyExcept((byte)0x00)))
src\runtime\src\libraries\System.Private.CoreLib\src\System\Version.cs (3)
391if (!TryParseComponent(input.Slice(0, majorEnd), nameof(input), throwOnFailure, input, out int major)) 399if (!TryParseComponent(input.Slice(majorEnd + 1, minorEnd - majorEnd - 1), nameof(input), throwOnFailure, input, out minor)) 408TryParseComponent(input.Slice(minorEnd + 1, buildEnd - minorEnd - 1), nameof(build), throwOnFailure, input, out build) &&
src\runtime\src\libraries\System.Reflection.Metadata\src\System\Reflection\Metadata\TypeName.cs (3)
349name = name.Slice(0, _nestedNameLength); 395rootFullName = rootFullName.Slice(0, rootTypeName._nestedNameLength); 399rootTypeName._namespace = rootFullName.Slice(0, idx).ToString();
src\runtime\src\libraries\System.Reflection.Metadata\src\System\Reflection\Metadata\TypeNameParser.cs (1)
85ReadOnlySpan<char> fullTypeName = _inputString.Slice(0, fullTypeNameLength);
src\runtime\src\libraries\System.Reflection.Metadata\src\System\Reflection\Metadata\TypeNameParserHelpers.cs (2)
141return offset < 0 ? input : input.Slice(0, offset); 246if (length > 1 && input[0] == '.' && input.Slice(0, length).LastIndexOf('.') == 0)
System.Private.DataContractSerialization (10)
System\Runtime\Serialization\Json\JsonEncodingStreamWrapper.cs (1)
260int charCount = _dec!.GetChars(buffer.Slice(0, size), _chars, false);
System\Runtime\Serialization\Json\JsonReaderDelegator.cs (1)
169ticksvalue = ticksvalue.Slice(0, indexOfTimeZoneOffset + 1); // +1 for Slice above
System\Xml\XmlBufferReader.cs (8)
401BinaryPrimitives.ReadInt32LittleEndian(bytes.Slice(8, 4)), 402BinaryPrimitives.ReadInt32LittleEndian(bytes.Slice(12, 4)), 403BinaryPrimitives.ReadInt32LittleEndian(bytes.Slice(4, 4)), 404BinaryPrimitives.ReadInt32LittleEndian(bytes.Slice(0, 4)) 980BinaryPrimitives.ReadInt32LittleEndian(bytes.Slice(8, 4)), 981BinaryPrimitives.ReadInt32LittleEndian(bytes.Slice(12, 4)), 982BinaryPrimitives.ReadInt32LittleEndian(bytes.Slice(4, 4)), 983BinaryPrimitives.ReadInt32LittleEndian(bytes.Slice(0, 4))
System.Private.Uri (32)
src\runtime\src\libraries\Common\src\System\Net\IPv6AddressHelper.Common.cs (2)
249if (!IPv4AddressHelper.IsValid(name.Slice(lastSequence, end - lastSequence), out int seqEnd, true, false, false)) 346scopeId = address.Slice(scopeStart, i - scopeStart);
System\DomainNameHelper.cs (3)
112hostname = hostname.Slice(0, invalidCharOrDelimiterIndex); 152ReadOnlySpan<char> label = hostname.Slice(0, labelLength); 244label = label.Slice(0, dotIndex);
System\IPv6AddressHelper.cs (1)
226if (!IPv4AddressHelper.IsValid(name.Slice(lastSequence, i - lastSequence), out int seqEnd, true, false, false))
System\PercentEncodingHelper.cs (2)
95dest.Append(input.Slice(totalCharsConsumed - charsToCopy, charsToCopy)); 170dest.Append(input.Slice(totalCharsConsumed - charsToCopy, charsToCopy + bytesLeftInBuffer));
System\Uri.cs (16)
1995str = str.Slice(0, str.Length - 1); 3178foreach (char c in str.Slice(0, schemeLength)) 3467original = original.Slice(0, original.Length - 1); 3481IriHelper.EscapeUnescapeIri(ref vsb, original.Slice(0, pathLength), isQuery: false); // Path 3496IriHelper.EscapeUnescapeIri(ref vsb, original.Slice(0, fragmentOffset), isQuery: true); // Query 3728IriHelper.EscapeUnescapeIri(ref vsb, slice.Slice(0, userInfoLength), isQuery: false); 3755newHost = string.Concat(newHost, str.Slice(i, hostLength)); 3765newHost = string.Concat(newHost, str.Slice(i, hostLength)); 3777if (!str.Slice(i, hostLength).ContainsAnyInRange('A', 'Z')) 3790ReadOnlySpan<char> host = str.Slice(i, hostLength); 3817newHost = string.Concat(newHost, str.Slice(i, hostLength)); 3892newHost = string.Concat(newHost, str.Slice(startPort, i - startPort)); 3919newHost = UriHelper.NormalizeAndConcat(newHost, str.Slice(i, endOfHost - i)); 3961newHost = UriHelper.NormalizeAndConcat(newHost, str.Slice(i, endOfHost - i)); 4216str.Slice(_info.Offset.Path, _info.Offset.Query - _info.Offset.Path), 4455share = share.Slice(0, i + 1);
System\UriExt.cs (2)
525string result = string.Concat(charsToUnescape.Slice(0, indexOfFirstToUnescape), vsb.AsSpan()); 582charsToUnescape.Slice(0, indexOfFirstToUnescape).CopyTo(destination);
System\UriHelper.cs (6)
174charsToEscape.Slice(0, indexOfFirstToEscape).CopyTo(destination); 225string result = string.Concat(charsToEscape.Slice(0, indexOfFirstToEscape), vsb.AsSpan()); 243dest.Append(stringToEscape.Slice(0, indexOfFirstToEscape)); 314vsb.Append(stringToEscape.Slice(0, charsToCopy)); 335foreach (char c in chars.Slice(0, i)) 462foreach (char c in chars.Slice(0, i))
System.Private.Windows.Core (5)
_generated\152\Windows.Win32.InlineArrayIndexerExtensions.g.cs (1)
26 return length < 0 ? value : value.Slice(0, length);
_generated\37\Windows.Win32.char.InlineArrays.g.cs (2)
65 internal readonly string ToString(int length) => AsReadOnlySpan().Slice(0, length).ToString(); 129 internal readonly string ToString(int length) => AsReadOnlySpan().Slice(0, length).ToString();
System\SpanReader.cs (2)
27set => _unread = Span[value..]; 241public void Advance(int count) => _unread = _unread[count..];
System.Private.Xml (6)
_generated\0\RegexGenerator.g.cs (3)
1010(charloop_ending_pos = inputSpan.Slice(charloop_starting_pos, charloop_ending_pos - charloop_starting_pos).LastIndexOf(']')) < 0) 1401(charloop_ending_pos = inputSpan.Slice(charloop_starting_pos, Math.Min(inputSpan.Length, charloop_ending_pos + 16) - charloop_starting_pos).LastIndexOf("EnsureArrayIndex(")) < 0) 1747(charloop_ending_pos = inputSpan.Slice(charloop_starting_pos, charloop_ending_pos - charloop_starting_pos).LastIndexOf(']')) < 0)
System\Xml\Core\XmlTextEncoder.cs (1)
293_textWriter.Write(text.Slice(startPos, i - startPos));
System\Xml\Serialization\XmlSerializationWriter.cs (1)
463Debug.Assert(!span.Slice(0, charsWritten).ContainsAny(escapeChars), "Primitive value contains illegal xml char.");
System\Xml\XPath\Internal\XPathScanner.cs (1)
343return span.Slice(0, i).ToString();
System.Reflection.Emit (1)
System\Reflection\Emit\CustomAttributeWrapper.cs (1)
97return Text.Encoding.UTF8.GetString(data.Slice(pos, len));
System.Reflection.Metadata (7)
src\runtime\src\libraries\Common\src\System\Reflection\AssemblyNameParser.cs (1)
266attributeValueSpan[parts[i]],
System\Reflection\Metadata\BlobBuilder.cs (1)
682buffer.Slice(0, bytesToCurrent).CopyTo(_buffer.AsSpan(Length));
System\Reflection\Metadata\TypeName.cs (3)
349name = name.Slice(0, _nestedNameLength); 395rootFullName = rootFullName.Slice(0, rootTypeName._nestedNameLength); 399rootTypeName._namespace = rootFullName.Slice(0, idx).ToString();
System\Reflection\Metadata\TypeNameParser.cs (1)
85ReadOnlySpan<char> fullTypeName = _inputString.Slice(0, fullTypeNameLength);
System\Reflection\Metadata\TypeNameParserHelpers.cs (1)
141return offset < 0 ? input : input.Slice(0, offset);
System.Resources.Extensions (2)
System\Resources\Extensions\TypeNameComparer.cs (2)
34return comma == -1 ? assemblyQualifiedTypeName : assemblyQualifiedTypeName.Slice(0, comma); 42return comma == -1 ? assemblyName : assemblyName.Slice(0, comma).TrimEnd(s_whiteSpaceChars);
System.Runtime.Numerics (38)
System\Number.BigInteger.cs (10)
181value = value[index..]; 240value = value[leadingBitsCount..]; 252value = value[TParser.DigitsPerBlock..]; 415intDigits = intDigits.Slice(0, intDigitsEnd); 434uint.TryParse(intDigits.Slice(0, PowersOf1e9.MaxPartialDigits), out uint partialVal); 496base1E9 = base1E9.Slice(0, BigIntegerCalculator.ActualLength(base1E9)); 518Recursive(powersOf1e9, powersOf1e9Index - 1, base1E9[multiplier1E9Length..], buffer); 1075bits.Slice(0, omittedLength).CopyTo(lower); 1434return pow1E9.Slice(from, toExclusive - from); 1604if (!TParser.TryParseSingleBlock(input.Slice(blockStart, TParser.DigitsPerBlock), out destination[i]))
System\Number.Polyfill.cs (1)
94if (DecodeFromUtfChar(span[i..], out Rune rune, out elemsConsumed) != OperationStatus.Done)
System\Numerics\BigInteger.cs (2)
428value.Slice(0, wholeLimbCount * nint.Size).CopyTo(MemoryMarshal.AsBytes(val.AsSpan())); 2903if (neg && (carry != 0 || bits.Slice(0, digitShift).ContainsAnyExcept(0u)))
System\Numerics\BigIntegerCalculator.DivRem.cs (8)
466left = left.Slice(0, ActualLength(left)); 484DivideCore(left.Slice(0, quotient.Length), right[0], quotient, ref carry); 543BurnikelZieglerD3n2n(left.Slice(right.Length), left.Slice(halfN, halfN), right, quotient.Slice(halfN), r1); 544BurnikelZieglerD3n2n(r1.Slice(0, right.Length), left.Slice(0, halfN), right, quotient.Slice(0, halfN), remainder); 564ReadOnlySpan<nuint> b2 = right.Slice(0, n); 580ReadOnlySpan<nuint> a2 = left12.Slice(0, n); 611left = left.Slice(0, ActualLength(left)); 612right = right.Slice(0, ActualLength(right));
System\Numerics\BigIntegerCalculator.FastReducer.cs (1)
109right = right.Slice(0, k);
System\Numerics\BigIntegerCalculator.PowMod.cs (2)
580Multiply(prev.Slice(0, prevLength), base2.Slice(0, base2Length), 634MultiplySelf(ref bits, resultLen, entry.Slice(0, entryLength), ref temp);
System\Numerics\BigIntegerCalculator.SquMul.cs (9)
109ReadOnlySpan<nuint> valueLow = value.Slice(0, n); 312ReadOnlySpan<nuint> left0 = left.Slice(0, n).TrimEnd((nuint)0); 313ReadOnlySpan<nuint> left1 = left.Slice(n, n).TrimEnd((nuint)0); 316ReadOnlySpan<nuint> right0 = right.Slice(0, n).TrimEnd((nuint)0); 430ReadOnlySpan<nuint> leftLow = left.Slice(0, n); 434ReadOnlySpan<nuint> rightLow = right.Slice(0, n); 492ReadOnlySpan<nuint> leftLow = left.Slice(0, n); 566v0 = value.Slice(0, n).TrimEnd((nuint)0); 574v1 = value.Slice(n, n).TrimEnd((nuint)0);
System\Numerics\BigIntegerCalculator.Utils.cs (2)
52right = right.Slice(0, left.Length); 61left = left.Slice(0, right.Length);
System\Numerics\Complex.Generic.cs (3)
1944if ((openBracket != 0) && (((style & NumberStyles.AllowLeadingWhite) == 0) || !text.Slice(0, openBracket).IsWhiteSpace(out _))) 1959ReadOnlySpan<TChar> slice = text.Slice(openBracket + 1, semicolon - openBracket - 1); 1980slice = text.Slice(semicolon + 1, closeBracket - semicolon - 1);
System.Security.Cryptography (67)
src\runtime\src\libraries\Common\src\Interop\Windows\BCrypt\Interop.Blobs.cs (2)
77byte[] value = blob.Slice(offset, count).ToArray(); 87blob.Slice(offset, count).CopyTo(destination);
src\runtime\src\libraries\Common\src\Interop\Windows\Kernel32\Interop.FormatMessage.cs (1)
85return buffer.Slice(0, length).ToString();
src\runtime\src\libraries\Common\src\System\Security\Cryptography\AsymmetricAlgorithmHelpers.Der.cs (2)
40writer.WriteKeyParameterInteger(input.Slice(0, halfLength)); 41writer.WriteKeyParameterInteger(input.Slice(halfLength, halfLength));
src\runtime\src\libraries\Common\src\System\Security\Cryptography\CngPkcs8.cs (2)
116ReadOnlySpan<byte> pkcs8Source = source.Slice(0, len); 217source = source.Slice(0, len);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\DSACng.SignVerify.cs (1)
135return hash.Slice(0, qLength);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\MLKem.Windows.cs (1)
47exportedSpan.Slice(blobHeaderSize + paramSetSize, keySize).CopyTo(destination);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\PemKeyHelpers.Factory.cs (6)
26ReadOnlySpan<char> label = pem[fields.Label]; 51pem = pem[offset..]; 68ReadOnlySpan<char> base64Contents = foundSlice[foundFields.Base64Data]; 110ReadOnlySpan<char> label = pem[fields.Label]; 125pem = pem[offset..]; 133ReadOnlySpan<char> base64Contents = foundSlice[foundFields.Base64Data];
src\runtime\src\libraries\Common\src\System\Security\Cryptography\Pkcs12Kdf.cs (2)
263bytes.Slice(0, destination.Length).CopyTo(destination); 294ReadOnlySpan<char> trimmed = password.Slice(0, destination.Length / 2);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\PqcBlobHelpers.cs (2)
252parameterSet = MemoryMarshal.Cast<byte, char>(blobBytes.Slice(index, parameterSetLength)); 255return blobBytes.Slice(index, keyLength);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\RsaPaddingProcessor.cs (3)
184ReadOnlySpan<byte> noZeros = source.Slice(2, 8); 506ReadOnlySpan<byte> maskedDb = em.Slice(0, dbLen); 507ReadOnlySpan<byte> h = em.Slice(dbLen, hLen);
System\Security\Cryptography\Aes.cs (1)
535source.Slice(0, 8).CopyTo(A);
System\Security\Cryptography\Base64Transforms.cs (1)
254inputBuffer.Slice(0, whitespaceIndex).CopyTo(transformBuffer.Slice(index));
System\Security\Cryptography\EccKeyFormatHelper.cs (4)
80FromECPrivateKey(key.Slice(0, firstValueLength), algId, out ECParameters ret); 136x = publicKeyBytes.Slice(1, key.PrivateKey.Length).ToArray(); 210X = publicKeyBytes.Slice(1, fieldWidth).ToArray(), 429curve.G.X = baseSpan.Slice(1, primeOrPoly.Length).ToArray();
System\Security\Cryptography\Helpers.cs (1)
291encodedValue.Slice(offset, length),
System\Security\Cryptography\PemEncoding.cs (4)
171ReadOnlySpan<TChar> label = pemData[labelRange]; 206if (!TryCountBase64<TChar, T>(pemData[contentRange], out int base64start, out int base64end, out int decodedSize)) 314if (T.IsValidBase64(str.Slice(start, end + 1 - start), out base64DecodedSize)) 609charsWritten += T.WriteBase64(remainingData.Slice(0, BytesPerLine), destination, charsWritten);
System\Security\Cryptography\PemEnumerator.cs (1)
51_contents = _contents[_pemFields.Location.End..];
System\Security\Cryptography\PemKeyHelpers.cs (6)
112ReadOnlySpan<char> label = pem[fields.Label]; 127pem = pem[offset..]; 135ReadOnlySpan<char> base64Contents = foundSlice[foundFields.Base64Data]; 173ReadOnlySpan<char> label = pem[fields.Label]; 204pem = pem[offset..]; 221ReadOnlySpan<char> base64Contents = foundSlice[foundFields.Base64Data];
System\Security\Cryptography\Rfc2898DeriveBytes.cs (4)
195bufferSpan.Slice(_startIndex, size).CopyTo(destination); 201bufferSpan.Slice(_startIndex, cb).CopyTo(destination); 215bufferSpan.Slice(0, _blockSize).CopyTo(destination.Slice(offset)); 220bufferSpan.Slice(0, remainder).CopyTo(destination.Slice(offset));
System\Security\Cryptography\RSA.cs (2)
897RSAKeyFormatHelper.ReadRsaPublicKey(source.Slice(0, localRead), ignored, out RSAParameters rsaParameters); 921source.Slice(0, firstValueLength),
System\Security\Cryptography\SymmetricPadding.cs (1)
167if (block.Slice(block.Length - padBytes, padBytes - 1).ContainsAnyExcept((byte)0))
System\Security\Cryptography\UniversalCryptoDecryptor.cs (1)
56inputBuffer = inputBuffer.Slice(0, inputBuffer.Length - _heldoverCipher.Length);
System\Security\Cryptography\X509Certificates\CertificateRequest.Load.cs (2)
51if (contents[fields.Label].SequenceEqual(PemLabels.Pkcs10CertificateRequest)) 55if (!Convert.TryFromBase64Chars(contents[fields.Base64Data], rented, out int bytesWritten) ||
System\Security\Cryptography\X509Certificates\CertificateRevocationListBuilder.Load.cs (2)
270if (contents[fields.Label].SequenceEqual(PemLabels.X509CertificateRevocationList)) 274if (!Convert.TryFromBase64Chars(contents[fields.Base64Data], rented, out int bytesWritten))
System\Security\Cryptography\X509Certificates\X509Certificate2.cs (12)
1529ReadOnlySpan<char> label = contents[fields.Label]; 1535if (!Convert.TryFromBase64Chars(contents[fields.Base64Data], certBytes, out int bytesWritten) 1770match = match.Slice(0, match.Length - 1); 1801embeddedSpan = embeddedSpan.Slice(0, embeddedSpan.Length - 1); 1898ReadOnlySpan<char> label = contents[fields.Label]; 1904return ExtractKeyFromPem(contents[fields.Location], factory, import); 1938ReadOnlySpan<char> label = contents[fields.Label]; 1942using (TAlg key = factory(contents[fields.Location], password)) 2003ReadOnlySpan<char> label = contents[fields.Label]; 2016bool result = Convert.TryFromBase64Chars(contents[fields.Base64Data], base64Buffer, out int base64Written); 2067ReadOnlySpan<char> label = contents[fields.Label]; 2107bool result = Convert.TryFromBase64Chars(contents[fields.Base64Data], base64Buffer, out int base64Written);
System\Security\Cryptography\X509Certificates\X509Certificate2Collection.cs (2)
445ReadOnlySpan<char> label = contents[fields.Label]; 452if (!Convert.TryFromBase64Chars(contents[fields.Base64Data], certBytes, out int bytesWritten)
System\Security\Cryptography\XmlKeyHelper.cs (1)
146if (!Convert.TryToBase64Chars(value.Slice(offset, localLength), base64, out int written))
System.Security.Cryptography.Pkcs (5)
src\runtime\src\libraries\Common\src\Interop\Windows\Kernel32\Interop.FormatMessage.cs (1)
85return buffer.Slice(0, length).ToString();
src\runtime\src\libraries\Common\src\System\Security\Cryptography\Pkcs12Kdf.cs (2)
263bytes.Slice(0, destination.Length).CopyTo(destination); 294ReadOnlySpan<char> trimmed = password.Slice(0, destination.Length / 2);
System\Security\Cryptography\Pkcs\CmsSignature.cs (2)
245ieeeSignature.Slice(0, fieldSize), 253ieeeSignature.Slice(fieldSize, fieldSize),
System.Security.Cryptography.ProtectedData (1)
src\runtime\src\libraries\Common\src\Interop\Windows\Kernel32\Interop.FormatMessage.cs (1)
85return buffer.Slice(0, length).ToString();
System.Text.Encodings.Web (5)
System\Text\Encodings\Web\TextEncoder.cs (5)
179string retVal = string.Concat(value.Slice(0, indexOfFirstCharToEncode), stringBuilder.AsSpan()); 295sourceSearchSpace = utf8Source.Slice(0, utf8Destination.Length); 304utf8Source.Slice(0, idxOfFirstByteToEncode).CopyTo(utf8Destination); // memcpy data that doesn't need to be encoded 425sourceSearchSpace = source.Slice(0, destination.Length); 434source.Slice(0, idxOfFirstCharToEncode).CopyTo(destination); // memcpy data that doesn't need to be encoded
System.Text.Json (88)
System\Text\Json\Document\JsonDocument.cs (19)
298ReadOnlySpan<byte> segment = data.Slice(row.Location, row.SizeOrLength); 351ReadOnlySpan<byte> segment = data.Slice(row.Location, row.SizeOrLength); 368if (!otherUtf8Text.StartsWith(segment.Slice(0, idx))) 392return _utf8Json.Span.Slice(row.Location, row.SizeOrLength); 404ReadOnlySpan<byte> segment = data.Slice(row.Location, row.SizeOrLength); 425ReadOnlySpan<byte> segment = data.Slice(row.Location, row.SizeOrLength); 447ReadOnlySpan<byte> segment = data.Slice(row.Location, row.SizeOrLength); 469ReadOnlySpan<byte> segment = data.Slice(row.Location, row.SizeOrLength); 491ReadOnlySpan<byte> segment = data.Slice(row.Location, row.SizeOrLength); 513ReadOnlySpan<byte> segment = data.Slice(row.Location, row.SizeOrLength); 535ReadOnlySpan<byte> segment = data.Slice(row.Location, row.SizeOrLength); 557ReadOnlySpan<byte> segment = data.Slice(row.Location, row.SizeOrLength); 579ReadOnlySpan<byte> segment = data.Slice(row.Location, row.SizeOrLength); 601ReadOnlySpan<byte> segment = data.Slice(row.Location, row.SizeOrLength); 623ReadOnlySpan<byte> segment = data.Slice(row.Location, row.SizeOrLength); 645ReadOnlySpan<byte> segment = data.Slice(row.Location, row.SizeOrLength); 667ReadOnlySpan<byte> segment = data.Slice(row.Location, row.SizeOrLength); 681ReadOnlySpan<byte> segment = data.Slice(row.Location, row.SizeOrLength); 695ReadOnlySpan<byte> segment = data.Slice(row.Location, row.SizeOrLength);
System\Text\Json\Document\JsonDocument.Parse.cs (2)
519valueSpan = reader.OriginalSpan.Slice( 591valueSpan = readerSpan.Slice((int)reader.TokenStartIndex, payloadLength);
System\Text\Json\Document\JsonDocument.PropertyNameSet.cs (1)
89ReadOnlySpan<byte> previousPropertyName = utf8Json.Span.Slice(range.Start, range.Length);
System\Text\Json\Document\JsonDocument.TryGetProperty.cs (3)
166ReadOnlySpan<byte> currentPropertyName = documentSpan.Slice(row.Location, row.SizeOrLength); 179currentPropertyName.Slice(0, idx).SequenceEqual(propertyName.Slice(0, idx)))
System\Text\Json\Document\JsonElement.cs (2)
1475return utf8Text.Slice(0, 0) == default; 1505return text.Slice(0, 0) == default;
System\Text\Json\JsonHelpers.cs (8)
315leftMiddle = leftFractional.Slice(0, -diff); 318rightFirst = rightIntegral.Slice(0, rightOffset); 334leftFirst = leftIntegral.Slice(0, leftOffset); 338rightMiddle = rightFractional.Slice(0, diff); 394intg = span.Slice(0, i); 407frac = span.Slice(0, i); 427frac = frac.Slice(0, iz); 453intg = intg.Slice(0, fz);
System\Text\Json\JsonHelpers.Date.cs (6)
175|| !TryGetNextTwoDigits(source.Slice(start: 5, length: 2), ref parseData.Month) 177|| !TryGetNextTwoDigits(source.Slice(start: 8, length: 2), ref parseData.Day)) 233|| !TryGetNextTwoDigits(source.Slice(start: 11, length: 2), ref parseData.Hour) 234|| !TryGetNextTwoDigits(source.Slice(start: 14, length: 2), ref parseData.Minute)) 267|| !TryGetNextTwoDigits(source.Slice(start: 17, length: 2), ref parseData.Second)) 358|| !TryGetNextTwoDigits(offsetData.Slice(0, 2), ref parseData.OffsetHours))
System\Text\Json\Reader\JsonReaderHelper.cs (3)
44builder.Append(span.Slice(0, i)); 80builder.Append(span.Slice(0, i)); 104data = data.Slice(0, lastLineFeedIndex);
System\Text\Json\Reader\JsonReaderHelper.Unescaping.cs (4)
396if (!source.Slice(0, idx).TryCopyTo(destination)) 446bool result = Utf8Parser.TryParse(source.Slice(idx + 1, 4), out int scalar, out int bytesConsumed, 'x'); 469result = Utf8Parser.TryParse(source.Slice(idx + 3, 4), out int lowSurrogate, out bytesConsumed, 'x'); 534remaining.Slice(0, nextUnescapedSegmentLength).CopyTo(destination.Slice(written));
System\Text\Json\Reader\Utf8JsonReader.cs (16)
623if (!other.StartsWith(localSpan.Slice(0, idx))) 658if (!other.Slice(matchedSoFar).StartsWith(span.Slice(0, idx))) 746ValueSpan = _buffer.Slice(_consumed, 1); 768ValueSpan = _buffer.Slice(_consumed, 1); 780ValueSpan = _buffer.Slice(_consumed, 1); 802ValueSpan = _buffer.Slice(_consumed, 1); 966ValueSpan = _buffer.Slice(_consumed, 1); 976ValueSpan = _buffer.Slice(_consumed, 1); 1027(int newLines, int lastLineFeedIndex) = JsonReaderHelper.CountNewLines(remaining.Slice(0, idx)); 1178ValueSpan = span.Slice(0, literal.Length); 1333ValueSpan = localBuffer.Slice(0, idx); 1432ValueSpan = data.Slice(0, idx); 1567ValueSpan = data.Slice(0, i); 2510(int newLines, int newLineIndex) = JsonReaderHelper.CountNewLines(localBuffer.Slice(0, idx)); 2563ValueSpan = _buffer.Slice(previousConsumed + 2, idx); 2581ValueSpan = _buffer.Slice(previousConsumed + 2, idx);
System\Text\Json\Reader\Utf8JsonReader.MultiSegment.cs (10)
341ValueSpan = _buffer.Slice(_consumed, 1); 351ValueSpan = _buffer.Slice(_consumed, 1); 529ValueSpan = span.Slice(0, literal.Length); 552span.Slice(0, amountToWrite).CopyTo(readSoFar); 562span.Slice(0, amountToWrite).CopyTo(readSoFar); 589span.Slice(0, amountToWrite).CopyTo(readSoFar.Slice(written)); 609span.Slice(0, amountToWrite).CopyTo(readSoFar.Slice(written)); 771ValueSpan = localBuffer.Slice(0, idx); 1100ValueSpan = data.Slice(0, idx); 1251ValueSpan = data.Slice(0, i);
System\Text\Json\Serialization\Converters\Value\EnumConverter.cs (1)
325next = rest.Slice(0, i).TrimEnd();
System\Text\Json\Serialization\JsonSerializer.Read.Utf8JsonReader.cs (2)
375valueSpan = reader.OriginalSpan.Slice( 429valueSpan = readerSpan.Slice((int)reader.TokenStartIndex, payloadLength);
System\Text\Json\Serialization\Metadata\PropertyRef.cs (2)
656 => BitConverter.ToUInt32(name) | ((ulong)BitConverter.ToUInt16(name.Slice(4, 2)) << 32), 667 => BitConverter.ToUInt32(name) | ((ulong)BitConverter.ToUInt16(name.Slice(4, 2)) << 32) | ((ulong)name[6] << 48),
System\Text\Json\ThrowHelper.Serialization.cs (1)
383str.Slice(0, MaxLength).CopyTo(builder);
System\Text\Json\Writer\JsonWriterHelper.Escaping.cs (2)
153value.Slice(0, indexOfFirstByteToEscape).CopyTo(destination); 277value.Slice(0, indexOfFirstByteToEscape).CopyTo(destination);
System\Text\Json\Writer\Utf8JsonWriter.cs (3)
133return partialStringDataBytes.Slice(0, length); 162return MemoryMarshal.Cast<byte, char>(partialStringDataBytes.Slice(0, length)); 190return partialStringDataBytes.Slice(0, length);
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Literal.cs (1)
31escapedPropertyNameSection.Slice(1, escapedPropertyNameSection.Length - 3);
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.String.cs (1)
27escapedPropertyNameSection.Slice(1, escapedPropertyNameSection.Length - 3);
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.StringSegment.cs (1)
439bytes = bytes.Slice(0, bytes.Length - leftoverSize);
System.Text.Json.SourceGeneration (1)
src\runtime\src\libraries\Common\src\SourceGenerators\SourceWriter.cs (1)
108next = remainingText.Slice(0, lineLength);
System.Text.RegularExpressions (8)
System\Text\RegularExpressions\RegexCaseEquivalences.cs (1)
156equivalences = EquivalenceCasingValues.Slice(index3, count);
System\Text\RegularExpressions\RegexFindOptimizations.cs (3)
462int i = textSpan.Slice(0, pos).LastIndexOf(LeadingPrefix.AsSpan()); 477int i = textSpan.Slice(0, pos).LastIndexOf(FixedDistanceLiteral.Char); 495ReadOnlySpan<char> span = textSpan.Slice(0, pos);
System\Text\RegularExpressions\RegexInterpreter.cs (1)
988i = inputSpan.Slice(runtextpos, len).IndexOf(ch);
System\Text\RegularExpressions\RegexNode.cs (2)
1443startingSpan = startingSpan.Slice(0, 1); 1459startingSpan = startingSpan.Slice(0, c);
System\Text\RegularExpressions\RegexParser.cs (1)
172vsb.Append(input.Slice(0, indexOfMetachar));
System.Text.RegularExpressions.Generator (4)
src\runtime\src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexCaseEquivalences.cs (1)
156equivalences = EquivalenceCasingValues.Slice(index3, count);
src\runtime\src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexNode.cs (2)
1443startingSpan = startingSpan.Slice(0, 1); 1459startingSpan = startingSpan.Slice(0, c);
src\runtime\src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexParser.cs (1)
172vsb.Append(input.Slice(0, indexOfMetachar));
System.Threading.AccessControl (1)
src\runtime\src\libraries\Common\src\Interop\Windows\Kernel32\Interop.FormatMessage.cs (1)
85return buffer.Slice(0, length).ToString();
System.Web.HttpUtility (1)
System\Web\Util\HttpEncoder.cs (1)
151vsb.Append(chars.Slice(0, i));
System.Windows.Forms (1)
System\Windows\Forms\Controls\ImageList\ImageListStreamer.cs (1)
60ReadOnlySpan<byte> remaining = reader.Span[reader.Position..];
System.Windows.Forms.Primitives (7)
_generated\19\Windows.Win32.char.InlineArrays.g.cs (5)
65 internal readonly string ToString(int length) => AsReadOnlySpan().Slice(0, length).ToString(); 129 internal readonly string ToString(int length) => AsReadOnlySpan().Slice(0, length).ToString(); 193 internal readonly string ToString(int length) => AsReadOnlySpan().Slice(0, length).ToString(); 257 internal readonly string ToString(int length) => AsReadOnlySpan().Slice(0, length).ToString(); 321 internal readonly string ToString(int length) => AsReadOnlySpan().Slice(0, length).ToString();
System\ComponentModel\TypeConverterHelper.cs (1)
55output[i] = (T)converter.ConvertFromString(context, culture, text[tokens[i]].ToString())!;
System\Windows\Forms\Automation\UiaTextRange.cs (1)
303ReadOnlySpan<char> rangeText = _provider.Text.AsSpan().Slice(Start, Length);
System.Xaml (7)
src\wpf\src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\ReflectionUtils.cs (3)
66fullName = fullName.Slice(0, fullName.Length - nameSlice.Length + commaIndex); 110assemblyVersion = assemblyName.Slice(versionIndex + Version.Length, tokenLength - Version.Length); 122assemblyToken = assemblyName.Slice(tokenIndex + PublicKeyToken.Length, tokenLength - PublicKeyToken.Length);
System\Xaml\Parser\GenericTypeNameScanner.cs (1)
162return typeName.Slice(0, openBracketNdx);
System\Xaml\XamlSchemaContext.cs (2)
184if (!values[segment].IsEmpty) 186sb.Append(char.ToLower(values[segment][0], TypeConverterHelper.InvariantEnglishUS));
System\Xaml\XamlType.cs (1)
1626typeName = string.Concat(typeNameSpan.Slice(0, index), subscript);
VBCSCompiler (7)
src\roslyn\src\Compilers\Server\VBCSCompiler\BuildServerController.cs (7)
245options.PipeName = argSpan[pipeArgPrefix.Length..].ToString(); 249var timeoutValue = argSpan[timeoutArgPrefix.Length..]; 260var parsedLogFilePath = argSpan[logArgPrefix.Length..]; 295var value = argSpan[purgeCacheArgPrefix.Length..].ToString(); 321var value = argSpan[cacheStatsArgPrefix.Length..].ToString(); 332var value = argSpan[cacheStatsVerbosityArgPrefix.Length..].ToString(); 343var value = argSpan[cachePathArgPrefix.Length..].ToString();