1075 references to Slice
Aspire.Dashboard (8)
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);
GenerateDocumentationAndConfigFiles (5)
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\Compilers\Core\Portable\InternalUtilities\StringTable.cs (1)
509if (!chunk.Span.Equals(array.AsSpan().Slice(chunkOffset, chunk.Length), StringComparison.Ordinal))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\ObjectWriter.cs (1)
375span.Slice(offset, segmentLength).CopyTo(buffer.AsSpan());
http2cat (6)
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\Shared\ServerInfrastructure\BufferWriter.cs (1)
146source.Slice(0, writable).CopyTo(_span);
IIS.FunctionalTests (6)
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\Shared\ServerInfrastructure\BufferWriter.cs (1)
146source.Slice(0, writable).CopyTo(_span);
IIS.LongTests (6)
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\Shared\ServerInfrastructure\BufferWriter.cs (1)
146source.Slice(0, writable).CopyTo(_span);
IIS.NewHandler.FunctionalTests (6)
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\Shared\ServerInfrastructure\BufferWriter.cs (1)
146source.Slice(0, writable).CopyTo(_span);
IIS.NewShim.FunctionalTests (6)
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\Shared\ServerInfrastructure\BufferWriter.cs (1)
146source.Slice(0, writable).CopyTo(_span);
IIS.ShadowCopy.Tests (1)
src\Shared\ServerInfrastructure\BufferWriter.cs (1)
146source.Slice(0, writable).CopyTo(_span);
IISExpress.FunctionalTests (6)
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\Shared\ServerInfrastructure\BufferWriter.cs (1)
146source.Slice(0, writable).CopyTo(_span);
illink (1)
ILLink.RoslynAnalyzer (1)
INamedTypeSymbolExtensions.cs (1)
29roSpan = roSpan.Slice(0, dot > 0 ? dot : 0);
InMemory.FunctionalTests (2)
BadHttpRequestTests.cs (2)
594line = line.AsSpan().Slice(0, nullIndex + 2).ToString(); 606var printableTarget = target.AsSpan().Slice(0, target.IndexOf('\0') + 1).ToString();
Metrics (4)
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\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\ObjectWriter.cs (1)
375span.Slice(offset, segmentLength).CopyTo(buffer.AsSpan());
Metrics.Legacy (4)
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\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\ObjectWriter.cs (1)
375span.Slice(offset, segmentLength).CopyTo(buffer.AsSpan());
Microsoft.AspNetCore.Components (4)
NavigationManager.cs (1)
298return uri[_baseUri.OriginalString.Length..];
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 (9)
FormMapping\FormDataReader.cs (1)
140var endIndex = key.Value.Span[startIndex..].IndexOf(']') + startIndex;
FormMapping\PrefixResolver.cs (8)
59separatorX = x.Value.Span[currentXPos..].IndexOfAny('.', '['); 60separatorY = y.Value.Span[currentYPos..].IndexOfAny('.', '['); 65return MemoryExtensions.CompareTo(x.Value.Span[currentXPos..], y.Value.Span[currentYPos..], StringComparison.Ordinal); 81x.Value.Span[currentXPos..][..separatorX], 82y.Value.Span[currentYPos..], StringComparison.Ordinal); 88var segmentX = x.Value.Span[currentXPos..][..separatorX]; 89var segmentY = y.Value.Span[currentYPos..][..separatorY];
Microsoft.AspNetCore.Components.Forms (1)
src\Components\Shared\src\ExpressionFormatting\ReverseStringBuilder.cs (1)
77span[remainingLength..].CopyTo(_currentBuffer);
Microsoft.AspNetCore.Components.Server (6)
src\submodules\MessagePack-CSharp\src\MessagePack.UnityClient\Assets\Scripts\MessagePack\BufferWriter.cs (1)
240source.Slice(copiedBytes, writable).CopyTo(_span);
src\submodules\MessagePack-CSharp\src\MessagePack.UnityClient\Assets\Scripts\MessagePack\MessagePackReader.cs (3)
738span = this.reader.CurrentSpan.Slice(this.reader.CurrentSpanIndex, length); 774string value = StringEncoding.UTF8.GetString(unreadSpan.Slice(0, byteLength)); 1113initializedChars += decoder.GetChars(this.reader.UnreadSpan.Slice(0, bytesRead), charArray.AsSpan(initializedChars), flush);
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)
179return uri.Slice(0, minPos); 202currentUriAbsolute.SequenceEqual(hrefAbsolute.Slice(0, hrefAbsolute.Length - 1), CaseInsensitiveComparer))
src\Components\Shared\src\ExpressionFormatting\ReverseStringBuilder.cs (1)
77span[remainingLength..].CopyTo(_currentBuffer);
Microsoft.AspNetCore.Http.Extensions (9)
src\Components\Endpoints\src\FormMapping\FormDataReader.cs (1)
140var endIndex = key.Value.Span[startIndex..].IndexOf(']') + startIndex;
src\Components\Endpoints\src\FormMapping\PrefixResolver.cs (8)
59separatorX = x.Value.Span[currentXPos..].IndexOfAny('.', '['); 60separatorY = y.Value.Span[currentYPos..].IndexOfAny('.', '['); 65return MemoryExtensions.CompareTo(x.Value.Span[currentXPos..], y.Value.Span[currentYPos..], StringComparison.Ordinal); 81x.Value.Span[currentXPos..][..separatorX], 82y.Value.Span[currentYPos..], StringComparison.Ordinal); 88var segmentX = x.Value.Span[currentXPos..][..separatorX]; 89var segmentY = y.Value.Span[currentYPos..][..separatorY];
Microsoft.AspNetCore.HttpLogging (3)
RequestBufferingStream.cs (2)
96if (span.Slice(0, innerCount).TryCopyTo(_tailMemory.Span)) 104BuffersExtensions.Write(this, span.Slice(0, innerCount));
ResponseBufferingStream.cs (1)
89var slice = span.Slice(0, innerCount);
Microsoft.AspNetCore.HttpOverrides (1)
IPNetwork.cs (1)
194if (!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.OutputCaching (2)
FormatterBinaryWriter.cs (1)
201value.Slice(start: 0, length: toWrite).CopyTo(available);
RecyclableSequenceBuilder.cs (1)
105buffer.Slice(0, toWrite).CopyTo(available);
Microsoft.AspNetCore.OutputCaching.Microbenchmarks (2)
EndToEndBenchmarks.cs (2)
84destination.Write(value.Slice(0, bytes)); 99value.Slice(0, bytes).CopyTo(span);
Microsoft.AspNetCore.ResponseCaching (1)
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); 162if (!hostSpan[hostParts[0]].IsEmpty) 164return new EdgeKey(hostSpan[hostParts[0]].ToString(), null); 169if (!hostSpan[hostParts[0]].IsEmpty) 171if (int.TryParse(hostSpan[hostParts[1]], out var port)) 173return new EdgeKey(hostSpan[hostParts[0]].ToString(), port); 175else if (hostSpan[hostParts[1]].Equals(WildcardHost, StringComparison.Ordinal)) 177return 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 (1)
src\Shared\HttpSys\RequestProcessing\NativeRequestContext.cs (1)
113ref Unsafe.As<byte, long>(ref MemoryMarshal.GetReference(timingInfo.Span[sizeof(long)..])),
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (6)
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\Shared\ServerInfrastructure\BufferWriter.cs (1)
146source.Slice(0, writable).CopyTo(_span);
Microsoft.AspNetCore.Server.IIS (2)
src\Shared\HttpSys\RequestProcessing\NativeRequestContext.cs (1)
113ref Unsafe.As<byte, long>(ref MemoryMarshal.GetReference(timingInfo.Span[sizeof(long)..])),
src\Shared\ServerInfrastructure\BufferWriter.cs (1)
146source.Slice(0, writable).CopyTo(_span);
Microsoft.AspNetCore.Server.Kestrel.Core (20)
Internal\Http\Http1Connection.cs (1)
863var 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)
227span = span.Slice(0, crIndex); 233span = span.Slice(0, span.Length - 1); 283span = span.Slice(0, lfIndex); 549handler.OnHeader(name: headerLine.Slice(0, nameEnd), value: headerLine[valueStart..valueEnd]);
Internal\Http2\Http2Connection.cs (1)
643httpVersion = HttpUtilities.GetKnownVersion(requestLine.Slice(requestLine.Length - 9, 8));
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\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\Shared\ServerInfrastructure\BufferWriter.cs (1)
146source.Slice(0, writable).CopyTo(_span);
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (2)
HttpParserTests.cs (2)
94line = line.AsSpan().Slice(0, nullIndex + 2).ToString(); 146var line = method.AsSpan().Slice(0, nullIndex + 1).ToString();
Microsoft.AspNetCore.Shared.Tests (13)
src\Shared\HttpSys\RequestProcessing\NativeRequestContext.cs (1)
113ref Unsafe.As<byte, long>(ref MemoryMarshal.GetReference(timingInfo.Span[sizeof(long)..])),
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\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\Shared\SegmentWriteStream.cs (1)
146buffer = buffer[bytesWritten..];
src\Shared\ServerInfrastructure\BufferWriter.cs (1)
146source.Slice(0, writable).CopyTo(_span);
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.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)
522if (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\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\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\ObjectWriter.cs (1)
375span.Slice(offset, segmentLength).CopyTo(buffer.AsSpan());
Microsoft.CodeAnalysis.AnalyzerUtilities (4)
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\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\ObjectWriter.cs (1)
375span.Slice(offset, segmentLength).CopyTo(buffer.AsSpan());
Microsoft.CodeAnalysis.BannedApiAnalyzers (4)
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\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\ObjectWriter.cs (1)
375span.Slice(offset, segmentLength).CopyTo(buffer.AsSpan());
Microsoft.CodeAnalysis.CodeStyle (4)
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\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\ObjectWriter.cs (1)
375span.Slice(offset, segmentLength).CopyTo(buffer.AsSpan());
Microsoft.CodeAnalysis.CSharp (7)
CSharpParseOptions.cs (1)
218singleNamespaceBuilder.Add(@namespace.Slice(currentIndex, dotIndex - currentIndex).ToString());
Parser\LanguageParser_InterpolatedString.cs (6)
109originalTextSpan[currentContentStart..interpolation.OpenBraceRange.Start])); 126originalTextSpan[currentContentStart..closeQuoteRange.Start])); 139var closeQuoteText = originalTextSpan[closeQuoteRange]; 148return closeQuoteText[afterNewLine..afterWhitespace]; 185var currentLineWhitespace = text[lineStartPosition..currentIndex]; 347var slice = text[start..currentIndex];
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (1)
Attributes\AttributeTests_WellKnownAttributes.cs (1)
39var typeName = spanName.Slice(0, lastDotIndex);
Microsoft.CodeAnalysis.Features (1)
MetadataAsSource\AbstractMetadataAsSourceService.DocCommentFormatter.cs (1)
199foreach (var c in span.Slice(0, end))
Microsoft.CodeAnalysis.Features.Test.Utilities (1)
EditAndContinue\SourceMarkers.cs (1)
133var regionText = plainSource.AsSpan().Slice(exceptionRegion.Index, exceptionRegion.Length);
Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers (4)
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\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\ObjectWriter.cs (1)
375span.Slice(offset, segmentLength).CopyTo(buffer.AsSpan());
Microsoft.CodeAnalysis.PublicApiAnalyzers (4)
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\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\ObjectWriter.cs (1)
375span.Slice(offset, segmentLength).CopyTo(buffer.AsSpan());
Microsoft.CodeAnalysis.ResxSourceGenerator (4)
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\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\ObjectWriter.cs (1)
375span.Slice(offset, segmentLength).CopyTo(buffer.AsSpan());
Microsoft.CodeAnalysis.Test.Utilities (1)
TestHelpers.cs (1)
165bytes[i] = parseByte(input.Slice(i << 1, 2), NumberStyles.HexNumber);
Microsoft.CodeAnalysis.Workspaces (5)
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\Compilers\Core\Portable\InternalUtilities\StringTable.cs (1)
509if (!chunk.Span.Equals(array.AsSpan().Slice(chunkOffset, chunk.Length), StringComparison.Ordinal))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\ObjectWriter.cs (1)
375span.Slice(offset, segmentLength).CopyTo(buffer.AsSpan());
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (1)
src\Compilers\Core\Portable\InternalUtilities\LittleEndianReader.cs (1)
46var result = _span.Slice(0, byteCount);
Microsoft.CodeAnalysis.Workspaces.UnitTests (1)
XxHash128Tests.cs (1)
111ReadOnlySpan<byte> slice = input.Slice(0, rand.Next(0, input.Length) + 1);
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.DotNet.SwaggerGenerator.CodeGenerator (2)
Helpers.cs (2)
32return value.Slice(wordStart.Value, idx - wordStart.Value); 53return value.Slice(0, 0);
Microsoft.Extensions.AI.AzureAIInference (1)
AzureAIInferenceEmbeddingGenerator.cs (1)
133base64 = base64.Slice(1, base64.Length - 2);
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.AI.OpenAI (2)
src\Shared\ServerSentEvents\SseFormatter.cs (1)
161ReadOnlySpan<byte> nextLine = data.Slice(0, lineLength);
src\Shared\ServerSentEvents\SseParser_1.cs (1)
364fieldName = line.Slice(0, colonPos);
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.Diagnostics.ResourceMonitoring (14)
Linux\LinuxUtilizationParserCgroupV1.cs (6)
137stat = stat.Slice(StartingTokens.Length, stat.Length - StartingTokens.Length); 224ReadOnlySpan<char> inactiveMemorySlice = memoryFile.Slice(index + TotalInactiveFile.Length, memoryFile.Length - index - TotalInactiveFile.Length); 274ReadOnlySpan<char> totalMemory = firstLine.Slice(MemTotal.Length, firstLine.Length - MemTotal.Length); 288ReadOnlySpan<char> unit = totalMemory.Slice(totalMemory.Length - 2, 2); 326ReadOnlySpan<char> group = groupIndex == -1 ? stats : stats.Slice(0, groupIndex); 345ReadOnlySpan<char> first = group.Slice(0, rangeIndex);
Linux\LinuxUtilizationParserCgroupV2.cs (7)
181stat = stat.Slice(StartingTokens.Length, stat.Length - StartingTokens.Length); 373ReadOnlySpan<char> inactiveMemorySlice = memoryFile.Slice(index + InactiveFile.Length, memoryFile.Length - index - InactiveFile.Length); 419ReadOnlySpan<char> totalMemory = firstLine.Slice(MemTotal.Length, firstLine.Length - MemTotal.Length); 433ReadOnlySpan<char> unit = totalMemory.Slice(totalMemory.Length - 2, 2); 471ReadOnlySpan<char> group = groupIndex == -1 ? stats : stats.Slice(0, groupIndex); 490ReadOnlySpan<char> first = group.Slice(0, rangeIndex); 654ReadOnlySpan<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.Http.Diagnostics (3)
Http\DownstreamDependencyMetadataManager.cs (3)
114routeSpan = routeSpan.Slice(0, routeSpan.Length - 1); 370requestRouteAsSpan = requestRouteAsSpan.Slice(0, requestRouteAsSpan.Length - 1); 404var nextDelimiterIndex = requestRouteAsSpan.Slice(i, requestPathEndIndex - i).IndexOf(trieCurrent.Delimiter) + i;
Microsoft.Extensions.Telemetry (11)
Http\HttpRouteFormatter.cs (5)
206_ = outputBuffer.AppendRedacted(redactor, httpPath.Slice(startIndex, length)); 211_ = outputBuffer.Append(httpPath.Slice(startIndex, length)); 220_ = outputBuffer.Append(httpPath.Slice(startIndex, length)); 247_ = outputBuffer.AppendRedacted(redactor, httpPath.Slice(startIndex, length)); 252_ = outputBuffer.Append(httpPath.Slice(startIndex, length));
Http\HttpRouteParser.cs (6)
257HttpRouteParameterRedactionMode.None => httpPath.Slice(startIndex, length).ToString(), 279return redactor.Redact(httpPathAsSpan.Slice(startIndex, length)); 282return httpPathAsSpan.Slice(startIndex, length).ToString(); 287return httpPathAsSpan.Slice(startIndex, length).ToString(); 309return redactor.Redact(httpPathAsSpan.Slice(startIndex, length)); 312return 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 (80)
Model\BPETokenizer.cs (10)
461EncodeWithCache(textSpanToEncode.Slice(split.Offset, split.Length), tokens, split.Offset, ref priorityQueue); 522EncodeToIdsWithCache(textSpanToEncode.Slice(split.Offset, split.Length), ids, maxTokenCount - ids.Count, out int length, ref priorityQueue); 583count += EncodeToIdsWithCache(textSpanToEncode.Slice(split.Offset, split.Length), null, maxTokenCount - count, out int length, ref priorityQueue); 663count += EncodeToIdsWithCache(textSpanToEncode.Slice(split.Offset, split.Length), null, maxTokenCount - count, out int length, ref priorityQueue); 717tokenCount += EncodeToIdsFromEndWithCache(textSpanToEncode.Slice(split.Offset, split.Length), null, maxTokenCount - tokenCount, out int textIndex, ref priorityQueue); 856span = span.Slice(0, span.Length - EndOfWordSuffix.Length); 953sSpan = sSpan.Slice(0, sSpan.Length - EndOfWordSuffix!.Length); 1032span = span.Slice(0, span.Length - EndOfWordSuffix.Length); 1202s = w.Slice(i, 2); 1207s = 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)
232EncodeToTokensInternal(text.Slice(currentOffset, Offset - currentOffset), considerNormalization, ref progressOffset, tokens, buffer, ref normalizedString, ref normalizedStringIndex); 235if (InternalSpecialTokens!.TryGetValue(text.Slice(Offset, Length), out int id)) 240StoreNormalizedText(text.Slice(Offset, Length), ref normalizedString, ref normalizedStringIndex); 659StoreNormalizedText(text.Slice(currentOffset, Offset - currentOffset), considerNormalization, buffer, ref normalizedString, ref normalizedStringIndex); 664EncodeToIdsInternal(text.Slice(currentOffset, Offset - currentOffset), considerNormalization, ids, buffer, ref normalizedString, ref normalizedStringIndex, ref charsConsumed, maxTokenCount); 668if (InternalSpecialTokens!.TryGetValue(text.Slice(Offset, Length), out int id)) 672StoreNormalizedText(text.Slice(Offset, Length), ref normalizedString, ref normalizedStringIndex); 1030StoreNormalizedText(text.Slice(currentOffset, Offset - currentOffset), considerNormalization, buffer, ref normalizedString, ref normalizedStringIndex); 1035CountTokensInternal(text.Slice(currentOffset, Offset - currentOffset), considerNormalization, ref tokenCount, buffer, ref normalizedString, ref normalizedStringIndex, ref charsConsumed, maxTokenCount); 1039if (InternalSpecialTokens!.TryGetValue(text.Slice(Offset, Length), out int id)) 1043StoreNormalizedText(text.Slice(Offset, Length), ref normalizedString, ref normalizedStringIndex); 1306if (InternalSpecialTokens!.TryGetValue(text.Slice(current.Offset, current.Length), out int id)) 1316StoreNormalizedTextFromEnd(text.Slice(current.Offset, current.Length), ref normalizedString, ref normalizedStringCountFromEnd); 1322GetIndexByTokenCountFromEndInternal(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)
213if (startIndex + tokenLength <= endIndex && original.Slice(startIndex, tokenLength).SequenceEqual(token.AsSpan())) 358ReadOnlySpan<byte> normalizedByte = normalizedPrefix.Length == 0 ? input.Slice(0, p) : normalizedPrefix.Span; 389ReadOnlySpan<byte> sp = normalizedPrefix.Length == 0 ? input.Slice(0, p) : normalizedPrefix.Span; 526fixed (byte* pBlob = blob.Slice(0, (int)trieBlobSize))
PreTokenizer\PreTokenizer.cs (1)
180foreach (ValueMatch m in regex.EnumerateMatches(text.Slice(beginning, length)))
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.Http.Headers (2)
MediaTypeHeaderValue.cs (2)
647mediaType = string.Concat(input.AsSpan().Slice(startIndex, typeLength), "/", input.AsSpan().Slice(current, subtypeLength));
Microsoft.NET.StringTools (1)
SpanBasedStringBuilder.cs (1)
180if (!MemoryExtensions.Equals(other.Slice(otherIndex, internalSpan.Length), internalSpan.Span, comparison))
PresentationBuildTasks (3)
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)
12004_fileName = traceSplits[splitRegions[0]].ToString(); 12008if (int.TryParse(traceSplits[splitRegions[1]], NumberStyles.Integer, CultureInfo.InvariantCulture, out int flushDepth)) 12016if (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)
1872zoomString = zoomString.Slice(0, zoomString.Length - 1);
Replay (1)
Replay.cs (1)
260var argName = line.AsSpan().Slice(0, index).ToString();
Roslyn.Diagnostics.Analyzers (4)
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\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\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.Diagnostics.DiagnosticSource (13)
System\Diagnostics\Activity.cs (2)
1967if (!Utf8Parser.TryParse(idData.Slice(0, 16), out span[0], out _, 'x')) 1974if (!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(); 256|| !double.TryParse(suffixPart.Slice(c_ParentRatioSamplerPrefix.Length, endingLocation - c_ParentRatioSamplerPrefix.Length), NumberStyles.Float, CultureInfo.InvariantCulture, out double ratio)) 274suffixPart.Slice(c_ParentRateLimitingSamplerPrefix.Length, endingLocation - c_ParentRateLimitingSamplerPrefix.Length), 332activitySourceName = activitySourceName.Slice(0, plusSignIndex).Trim();
System\Diagnostics\Metrics\TagList.netcore.cs (2)
276tags = tags.Slice(0, _tagsCount); 305((ReadOnlySpan<KeyValuePair<string, object?>>)_tags).Slice(0, _tagsCount);
System\Diagnostics\W3CPropagator.cs (4)
100ReadOnlySpan<char> currentEntry = entrySeparator >= 0 ? baggageSpan.Slice(0, entrySeparator) : baggageSpan; 108ReadOnlySpan<char> keySpan = currentEntry.Slice(0, keyValueSeparator); 151ReadOnlySpan<char> entry = commaIndex >= 0 ? traceStateSpan.Slice(0, commaIndex) : traceStateSpan; 165if (IsInvalidTraceStateKey(Trim(entry.Slice(0, equalIndex))) || IsInvalidTraceStateValue(TrimSpaceOnly(entry.Slice(equalIndex + 1))))
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\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 (110)
System\Formats\Asn1\AsnCharacterStringEncodings.cs (1)
382bytes.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 (3)
642return source.Slice(0, len); 654return source.Slice(offset, length); 673return source.Slice(offset, lengthVal);
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.SetOf.cs (1)
111ReadOnlySpan<byte> current = remaining.Slice(0, consumed);
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 (99)
223"1.2.840.10040.4.1" => data.Slice(0, 7), // DSA 224"1.2.840.10040.4.3" => data.Slice(7, 7), // DSAWithSha1 225"1.2.840.10045.2.1" => data.Slice(14, 7), // EC 226"1.2.840.10045.1.1" => data.Slice(21, 7), // EcPrimeField 227"1.2.840.10045.1.2" => data.Slice(28, 7), // EcChar2Field 228"1.2.840.10045.3.1.7" => data.Slice(35, 8), // Secp256r1 229"1.2.840.10045.4.1" => data.Slice(43, 7), // ECDSAWithSha1 230"1.2.840.10045.4.3.2" => data.Slice(50, 8), // ECDSAWithSha256 231"1.2.840.10045.4.3.3" => data.Slice(58, 8), // ECDSAWithSha384 232"1.2.840.10045.4.3.4" => data.Slice(66, 8), // ECDSAWithSha512 233"1.2.840.113549.1.1.1" => data.Slice(74, 9), // RSA 234"1.2.840.113549.1.1.5" => data.Slice(83, 9), // RSAWithSha1 235"1.2.840.113549.1.1.7" => data.Slice(92, 9), // RSAOAEP 236"1.2.840.113549.1.1.8" => data.Slice(101, 9), // MGF1 237"1.2.840.113549.1.1.9" => data.Slice(110, 9), // OaepPSpecified 238"1.2.840.113549.1.1.10" => data.Slice(119, 9), // RSAPSS 239"1.2.840.113549.1.1.11" => data.Slice(128, 9), // RSAWithSha256 240"1.2.840.113549.1.1.12" => data.Slice(137, 9), // RSAWithSha384 241"1.2.840.113549.1.1.13" => data.Slice(146, 9), // RSAWithSha512 242"1.2.840.113549.1.5.3" => data.Slice(155, 9), // PbeWithMD5AndDESCBC 243"1.2.840.113549.1.5.10" => data.Slice(164, 9), // PbeWithSha1AndDESCBC 244"1.2.840.113549.1.5.11" => data.Slice(173, 9), // PbeWithSha1AndRC2CBC 245"1.2.840.113549.1.5.12" => data.Slice(182, 9), // Pbkdf2 246"1.2.840.113549.1.5.13" => data.Slice(191, 9), // PasswordBasedEncryptionScheme2 247"1.2.840.113549.1.7.1" => data.Slice(200, 9), // Pkcs7Data 248"1.2.840.113549.1.7.2" => data.Slice(209, 9), // Pkcs7SignedData 249"1.2.840.113549.1.7.3" => data.Slice(218, 9), // Pkcs7EnvelopedData 250"1.2.840.113549.1.7.6" => data.Slice(227, 9), // Pkcs7EncryptedData 251"1.2.840.113549.1.9.1" => data.Slice(236, 9), // Pkcs9EmailAddress 252"1.2.840.113549.1.9.3" => data.Slice(245, 9), // Pkcs9ContentType 253"1.2.840.113549.1.9.4" => data.Slice(254, 9), // Pkcs9MessageDigest 254"1.2.840.113549.1.9.5" => data.Slice(263, 9), // Pkcs9SigningTime 255"1.2.840.113549.1.9.6" => data.Slice(272, 9), // Pkcs9CounterSigner 256"1.2.840.113549.1.9.7" => data.Slice(281, 9), // Pkcs9Challenge 257"1.2.840.113549.1.9.14" => data.Slice(290, 9), // Pkcs9ExtensionRequest 258"1.2.840.113549.1.9.15" => data.Slice(299, 9), // Pkcs9SMimeCapabilities 259"1.2.840.113549.1.9.16.1.4" => data.Slice(308, 11), // TstInfo 260"1.2.840.113549.1.9.16.2.12" => data.Slice(319, 11), // SigningCertificateAttr 261"1.2.840.113549.1.9.16.2.14" => data.Slice(330, 11), // SignatureTimeStampAttr 262"1.2.840.113549.1.9.16.2.47" => data.Slice(341, 11), // SigningCertificateV2Attr 263"1.2.840.113549.1.9.20" => data.Slice(352, 9), // Pkcs9FriendlyName 264"1.2.840.113549.1.9.21" => data.Slice(361, 9), // LocalKeyId 265"1.2.840.113549.1.9.22.1" => data.Slice(370, 10), // Pkcs12X509CertType 266"1.2.840.113549.1.12.1.3" => data.Slice(380, 10), // Pkcs12TripleDes 267"1.2.840.113549.1.12.1.5" => data.Slice(390, 10), // Pkcs12Rc2Cbc128 268"1.2.840.113549.1.12.1.6" => data.Slice(400, 10), // Pkcs12Rc2Cbc40 269"1.2.840.113549.1.12.10.1.1" => data.Slice(410, 11), // Pkcs12KeyBag 270"1.2.840.113549.1.12.10.1.2" => data.Slice(421, 11), // Pkcs12ShroudedKeyBag 271"1.2.840.113549.1.12.10.1.3" => data.Slice(432, 11), // Pkcs12CertBag 272"1.2.840.113549.1.12.10.1.5" => data.Slice(443, 11), // Pkcs12SecretBag 273"1.2.840.113549.1.12.10.1.6" => data.Slice(454, 11), // Pkcs12SafeContentsBag 274"1.2.840.113549.2.5" => data.Slice(465, 8), // MD5 275"1.2.840.113549.2.7" => data.Slice(473, 8), // HMACSHA1 276"1.2.840.113549.2.9" => data.Slice(481, 8), // HMACSHA256 277"1.2.840.113549.2.10" => data.Slice(489, 8), // HMACSHA384 278"1.2.840.113549.2.11" => data.Slice(497, 8), // HMACSHA512 279"1.2.840.113549.3.2" => data.Slice(505, 8), // RC2CBC 280"1.2.840.113549.3.7" => data.Slice(513, 8), // TripleDESCBC 281"1.3.6.1.4.1.311.17.1" => data.Slice(521, 9), // Pkcs12KeyProviderName 282"1.3.6.1.4.1.311.17.3.20" => data.Slice(530, 10), // KeyIdentifier 283"1.3.6.1.4.1.311.20.2.3" => data.Slice(540, 10), // UserPrincipalName 284"1.3.6.1.4.1.311.88.2.1" => data.Slice(550, 10), // DocumentNameAttr 285"1.3.6.1.4.1.311.88.2.2" => data.Slice(560, 10), // DocumentDescriptionAttr 286"1.3.6.1.5.5.7.3.1" => data.Slice(570, 8), // KeyPurposeTlsServer 287"1.3.6.1.5.5.7.3.2" => data.Slice(578, 8), // KeyPurposeTlsClient 288"1.3.6.1.5.5.7.3.3" => data.Slice(586, 8), // KeyPurposeCodeSign 289"1.3.6.1.5.5.7.3.4" => data.Slice(594, 8), // KeyPurposeEmailProtection 290"1.3.6.1.5.5.7.3.8" => data.Slice(602, 8), // KeyPurposeTimestamping 291"1.3.6.1.5.5.7.3.9" => data.Slice(610, 8), // KeyPurposeOcspSigner 292"1.3.6.1.5.5.7.6.2" => data.Slice(618, 8), // Pkcs7NoSignature 293"1.3.6.1.5.5.7.48.1" => data.Slice(626, 8), // OCSP 294"1.3.6.1.5.5.7.48.1.2" => data.Slice(634, 9), // OcspNonce 295"1.3.6.1.5.5.7.48.2" => data.Slice(643, 8), // CAIssuers 296"1.3.14.3.2.26" => data.Slice(651, 5), // SHA1 297"1.3.14.3.2.7" => data.Slice(656, 5), // DES 298"1.3.132.0.34" => data.Slice(661, 5), // Secp384r1 299"1.3.132.0.35" => data.Slice(666, 5), // Secp521r1 300"2.5.4.3" => data.Slice(671, 3), // CommonName 301"2.5.4.5" => data.Slice(674, 3), // SerialNumber 302"2.5.4.6" => data.Slice(677, 3), // CountryOrRegionName 303"2.5.4.7" => data.Slice(680, 3), // Locality 304"2.5.4.8" => data.Slice(683, 3), // StateOrProvinceName 305"2.5.4.10" => data.Slice(686, 3), // OrganizationName 306"2.5.4.11" => data.Slice(689, 3), // OrganizationalUnit 307"2.5.4.97" => data.Slice(692, 3), // OrganizationIdentifier 308"2.5.29.14" => data.Slice(695, 3), // SubjectKeyIdentifier 309"2.5.29.15" => data.Slice(698, 3), // KeyUsage 310"2.5.29.17" => data.Slice(701, 3), // SubjectAlternativeName 311"2.5.29.19" => data.Slice(704, 3), // BasicConstraints 312"2.5.29.20" => data.Slice(707, 3), // CrlNumber 313"2.5.29.35" => data.Slice(710, 3), // AuthorityKeyIdentifier 314"2.16.840.1.101.3.4.1.2" => data.Slice(713, 9), // Aes128Cbc 315"2.16.840.1.101.3.4.1.22" => data.Slice(722, 9), // Aes192Cbc 316"2.16.840.1.101.3.4.1.42" => data.Slice(731, 9), // Aes256Cbc 317"2.16.840.1.101.3.4.2.1" => data.Slice(740, 9), // Sha256 318"2.16.840.1.101.3.4.2.2" => data.Slice(749, 9), // Sha384 319"2.16.840.1.101.3.4.2.3" => data.Slice(758, 9), // Sha512 320"2.23.140.1.2.1" => data.Slice(767, 6), // CabForumDV 321"2.23.140.1.2.2" => data.Slice(773, 6), // CabForumOV
System.Formats.Cbor (14)
System\Formats\Cbor\Reader\CborReader.Map.cs (3)
139ReadOnlySpan<byte> previousKeyEncoding = buffer.Slice(previousKeyEncodingRange.Offset, previousKeyEncodingRange.Length); 140ReadOnlySpan<byte> currentKeyEncoding = buffer.Slice(currentKeyEncodingRange.Offset, currentKeyEncodingRange.Length); 210return _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); 189ReadOnlySpan<byte> encodedString = buffer.Slice(bytesRead, length); 237ReadOnlySpan<byte> encodedSlice = buffer.Slice(bytesRead, byteLength); 340source.Slice(o, l).CopyTo(target); 365source.Slice(o, l).CopyTo(destination); 386concatenatedStringSize += ValidateUtf8AndGetCharCount(buffer.Slice(o, l), utf8Encoding); 403int charsWritten = CborHelpers.GetChars(input.utf8Encoding, source.Slice(o, l), target); 421concatenatedStringSize += ValidateUtf8AndGetCharCount(buffer.Slice(o, l), utf8Encoding); 432CborHelpers.GetChars(utf8Encoding, buffer.Slice(o, l), destination); 497ReadOnlySpan<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 (30)
src\libraries\Common\src\System\IO\PathInternal.cs (2)
139sb.Append(path.Slice(0, skip)); 235path.Slice(0, path.Length - 1) :
System\Formats\Tar\TarHeader.Read.cs (19)
367ReadOnlySpan<byte> spanChecksum = buffer.Slice(FieldLocations.Checksum, FieldLengths.Checksum); 379long size = TarHelpers.ParseNumeric<long>(buffer.Slice(FieldLocations.Size, FieldLengths.Size)); 387name: TarHelpers.GetTrimmedUtf8String(buffer.Slice(FieldLocations.Name, FieldLengths.Name)), 388mode: TarHelpers.ParseNumeric<int>(buffer.Slice(FieldLocations.Mode, FieldLengths.Mode)), 389mTime: ParseAsTimestamp(buffer.Slice(FieldLocations.MTime, FieldLengths.MTime)), 394_uid = TarHelpers.ParseNumeric<int>(buffer.Slice(FieldLocations.Uid, FieldLengths.Uid)), 395_gid = TarHelpers.ParseNumeric<int>(buffer.Slice(FieldLocations.Gid, FieldLengths.Gid)), 396_linkName = TarHelpers.GetTrimmedUtf8String(buffer.Slice(FieldLocations.LinkName, FieldLengths.LinkName)) 431ReadOnlySpan<byte> magic = buffer.Slice(FieldLocations.Magic, FieldLengths.Magic); 470ReadOnlySpan<byte> version = buffer.Slice(FieldLocations.Version, FieldLengths.Version); 520_uName = TarHelpers.GetTrimmedUtf8String(buffer.Slice(FieldLocations.UName, FieldLengths.UName)); 521_gName = TarHelpers.GetTrimmedUtf8String(buffer.Slice(FieldLocations.GName, FieldLengths.GName)); 528_devMajor = TarHelpers.ParseNumeric<int>(buffer.Slice(FieldLocations.DevMajor, FieldLengths.DevMajor)); 531_devMinor = TarHelpers.ParseNumeric<int>(buffer.Slice(FieldLocations.DevMinor, FieldLengths.DevMinor)); 539_aTime = ParseAsTimestamp(buffer.Slice(FieldLocations.ATime, FieldLengths.ATime)); 541_cTime = ParseAsTimestamp(buffer.Slice(FieldLocations.CTime, FieldLengths.CTime)); 563_prefix = TarHelpers.GetTrimmedUtf8String(buffer.Slice(FieldLocations.Prefix, FieldLengths.Prefix)); 726ReadOnlySpan<byte> line = buffer.Slice(0, newlinePos); 746ReadOnlySpan<byte> keySlice = line.Slice(0, equalPos);
System\Formats\Tar\TarHeader.Write.cs (8)
571name = name.Slice(0, utf16NameTruncatedLength); 613prefix = pathNameBytes.Slice(0, lastIdx); 627prefix = pathNameBytes.Slice(0, lastIdx); 691linkName = linkName.Slice(0, truncatedLength); 749uName = uName.Slice(0, truncatedLength); 767gName = gName.Slice(0, truncatedLength); 1063bytesToWrite = bytesToWrite.Slice(0, numToCopy); 1080bytesToWrite = bytesToWrite.Slice(0, numToCopy);
System\Formats\Tar\TarHelpers.cs (1)
287return buffer.Slice(0, trimmedLength);
System.IO.FileSystem.Watcher (2)
src\libraries\Common\src\System\IO\PathInternal.cs (2)
139sb.Append(path.Slice(0, skip)); 235path.Slice(0, path.Length - 1) :
System.IO.Hashing (7)
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)
266source.Slice(0, loadSize).CopyTo(new Span<byte>(buffer + state.BufferedCount, loadSize)); 305source.Slice(sourceIndex - StripeLengthBytes, StripeLengthBytes).CopyTo(new Span<byte>(buffer + InternalBufferLengthBytes - StripeLengthBytes, StripeLengthBytes)); 318source.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)
1105source.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)
151sourceSpan.Slice(sourceIndex, destination.Length).CopyTo(destination); 172return 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.Memory.Data (1)
src\libraries\Common\src\System\IO\ReadOnlyMemoryStream.cs (1)
120_content.Span.Slice(_position, buffer.Length).CopyTo(buffer);
System.Net.HttpListener (3)
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 (3)
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.Security (1)
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)
347fieldName = line.Slice(0, colonPos);
System.Net.WebClient (1)
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)
33_sliceShape = TensorShape.Create((dimension != tensor.Rank) ? tensor.Lengths[dimension..] : [1], tensor.Strides[dimension..], tensor.IsPinned);
System\Numerics\Tensors\netcore\Tensor.cs (8)
1645span.Slice(0, ospan.Length).CopyTo(ospan); 1685span.Slice(0, ospan.Length).CopyTo(ospan); 2337tensor.Lengths.Slice(0, dimension).CopyTo(newLengths); 2349tensor.Strides.Slice(0, dimension).CopyTo(newStrides); 2374tensor.Lengths.Slice(0, dimension).CopyTo(newLengths); 2386tensor.Strides.Slice(0, dimension).CopyTo(newStrides); 2411tensor.Lengths.Slice(0, dimension).CopyTo(newLengths); 2423tensor.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)
598ReadOnlySpan<nint> lengths1 = shape1.Lengths[rankDelta..]; 628ReadOnlySpan<nint> strides1 = shape1.Strides[rankDelta..]; 669ReadOnlySpan<nint> lengths1 = shape1Lengths[rankDelta..];
System.Private.CoreLib (147)
src\libraries\Common\src\Interop\Linux\procfs\Interop.ProcFsStat.TryReadStatusFile.cs (1)
88switch (line.Slice(0, startIndex)) // name
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\libraries\Common\src\Interop\Windows\Kernel32\Interop.FormatMessage.cs (1)
84return buffer.Slice(0, length).ToString();
src\libraries\Common\src\System\IO\PathInternal.cs (2)
139sb.Append(path.Slice(0, skip)); 235path.Slice(0, path.Length - 1) :
src\libraries\Common\src\System\Reflection\AssemblyNameParser.cs (1)
266attributeValueSpan[parts[i]],
src\libraries\System.Private.CoreLib\src\System\Boolean.cs (1)
314return value.Slice(start, end - start + 1);
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\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\libraries\System.Private.CoreLib\src\System\Byte.cs (1)
345if ((source.Length > sizeof(byte)) && (source[sizeof(byte)..].ContainsAnyExcept((byte)0x00)))
src\libraries\System.Private.CoreLib\src\System\Char.cs (1)
1276if ((source.Length > sizeof(char)) && (source[sizeof(char)..].ContainsAnyExcept((byte)0x00)))
src\libraries\System.Private.CoreLib\src\System\Convert.cs (2)
3006source = source.Slice(0, destination.Length * 2); 3014source = source.Slice(0, source.Length - 1);
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\libraries\System.Private.CoreLib\src\System\Enum.cs (1)
1069subvalue = value.Slice(0, endIndex).Trim();
src\libraries\System.Private.CoreLib\src\System\Environment.Variables.Windows.cs (1)
109string key = new string(variable.Slice(0, i));
src\libraries\System.Private.CoreLib\src\System\Globalization\CompareInfo.Icu.cs (1)
198: source.Slice(0, startIndex);
src\libraries\System.Private.CoreLib\src\System\Globalization\CultureData.Icu.cs (1)
329span = span.Slice(0, span.IndexOf('\0'));
src\libraries\System.Private.CoreLib\src\System\Globalization\DateTimeFormatInfo.cs (1)
2367Culture.CompareInfo.Compare(str.Value.Slice(str.Index, value.tokenString.Length), value.tokenString, CompareOptions.IgnoreCase) == 0))
src\libraries\System.Private.CoreLib\src\System\Globalization\DateTimeParse.cs (7)
416if (str.CompareInfo.Compare(str.Value.Slice(str.Index, target.Length), target, CompareOptions.IgnoreCase) != 0) 5581m_info.Compare(Value.Slice(Index, target.Length), target, CompareOptions.IgnoreCase) == 0; 5588if (matchLength > valueRemaining || m_info.Compare(Value.Slice(Index, matchLength), target, CompareOptions.IgnoreCase) != 0) 5620if (m_info.CompareOptionIgnoreCase(Value.Slice(thisPosition, segmentLength), target.AsSpan(targetPosition, segmentLength)) != 0) 5653if (m_info.CompareOptionIgnoreCase(Value.Slice(thisPosition, segmentLength), target.AsSpan(targetPosition, segmentLength)) != 0) 5848Value = Value.Slice(0, i + 1); 5873Value.Slice(0, i).CopyTo(result);
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\libraries\System.Private.CoreLib\src\System\Globalization\InvariantModeCasing.cs (2)
59src.Slice(0, i).CopyTo(destination); 105src.Slice(0, i).CopyTo(destination);
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\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\libraries\System.Private.CoreLib\src\System\Globalization\TimeSpanParse.cs (1)
255return new TimeSpanToken(TTT.Sep, 0, 0, _value.Slice(startPos, length));
src\libraries\System.Private.CoreLib\src\System\Guid.cs (15)
505return TryParseExactD(guidString.Slice(1, 36), ref result); 565if (TryParseHex(guidString.Slice(0, 8), out result._a) && // _a 566TryParseHex(guidString.Slice(9, 4), out uint uintTmp)) // _b 569if (TryParseHex(guidString.Slice(14, 4), out uintTmp)) // _c 572if (TryParseHex(guidString.Slice(19, 4), out uintTmp)) // _d, _e 575if (TryParseHex(guidString.Slice(24, 4), out uintTmp)) // _f, _g 580if (Number.TryParseBinaryIntegerHexNumberStyle(guidString.Slice(28, 8), NumberStyles.AllowHexSpecifier, out uintTmp) == Number.ParsingStatus.OK) // _h, _i, _j, _k 647return TryParseExactD(guidString.Slice(1, 36), ref result); 691if (!TryParseHex(guidString.Slice(numStart, numLen), out result._a, ref overflow) || overflow) 713if (!TryParseHex(guidString.Slice(numStart, numLen), out result._b, ref overflow) || overflow) 735if (!TryParseHex(guidString.Slice(numStart, numLen), out result._c, ref overflow) || overflow) 783if (!TryParseHex(guidString.Slice(numStart, numLen), out uint byteVal, ref overflow) || overflow || byteVal > byte.MaxValue) 904charSpan.Slice(0, i).CopyTo(chArr); 955srcUtf8Span.Slice(0, i).CopyTo(destUtf8Span); 969srcUtf8Span.Slice(i, bytesConsumed).CopyTo(destUtf8Span.Slice(newLength));
src\libraries\System.Private.CoreLib\src\System\Int128.cs (1)
859if (source[Size..].ContainsAnyExcept((byte)sign))
src\libraries\System.Private.CoreLib\src\System\Int16.cs (1)
400if (source[sizeof(short)..].ContainsAnyExcept((byte)sign))
src\libraries\System.Private.CoreLib\src\System\Int32.cs (1)
427if (source[sizeof(int)..].ContainsAnyExcept((byte)sign))
src\libraries\System.Private.CoreLib\src\System\Int64.cs (1)
424if (source[sizeof(long)..].ContainsAnyExcept((byte)sign))
src\libraries\System.Private.CoreLib\src\System\IntPtr.cs (1)
429if (source[sizeof(nint_t)..].ContainsAnyExcept((byte)sign))
src\libraries\System.Private.CoreLib\src\System\IO\BufferedStream.cs (1)
787buffer.Slice(0, bytesToWrite).CopyTo(new Span<byte>(_buffer, _writePos, bytesToWrite));
src\libraries\System.Private.CoreLib\src\System\IO\File.cs (1)
1541ReadOnlySpan<char> toEncode = contents.Slice(0, Math.Min(contents.Length, ChunkSize));
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\libraries\System.Private.CoreLib\src\System\IO\Strategies\BufferedFileStreamStrategy.cs (2)
507source.Slice(0, numBytes).CopyTo(_buffer!.AsSpan(_writePos)); 708source.Span.Slice(0, spaceLeft).CopyTo(_buffer.AsSpan(_writePos));
src\libraries\System.Private.CoreLib\src\System\IO\StreamReader.cs (2)
819retVal = new string(charBufferSpan.Slice(0, idxOfNewline)); 823retVal = string.Concat(vsb.AsSpan(), charBufferSpan.Slice(0, idxOfNewline));
src\libraries\System.Private.CoreLib\src\System\IO\StreamWriter.cs (1)
792source.Span.Slice(copied, n).CopyTo(new Span<char>(_charBuffer, _charPos, n));
src\libraries\System.Private.CoreLib\src\System\MemoryExtensions.cs (4)
2564pos = span.Slice(0, pos).LastIndexOf(value[0], comparer); 3585SequenceEqual(span.Slice(0, value.Length), value, comparer); 4961other = other.Slice(0, span.Length); 4965span = span.Slice(0, other.Length);
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\libraries\System.Private.CoreLib\src\System\MemoryExtensions.Trim.Utf8.cs (2)
31span = span[firstBytesConsumed..]; 57span = span[bytesConsumed..];
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\libraries\System.Private.CoreLib\src\System\Reflection\AssemblyName.cs (1)
367vsb.Append(stringToEscape.Slice(0, charsToCopy));
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\libraries\System.Private.CoreLib\src\System\SByte.cs (1)
381if (source[sizeof(sbyte)..].ContainsAnyExcept((byte)sign))
src\libraries\System.Private.CoreLib\src\System\SearchValues\ProbabilisticWithAsciiCharSearchValues.cs (2)
181span = span.Slice(0, offset + 1); 209span = span.Slice(0, offset + 1);
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\libraries\System.Private.CoreLib\src\System\Security\SecurityElement.cs (1)
334sb.Append(span.Slice(0, pos)).Append(GetEscapeSequence(span[pos]));
src\libraries\System.Private.CoreLib\src\System\String.Manipulation.cs (4)
1243result.Append(searchSpace.Slice(0, index)); 1536builder.Append(remaining.Slice(0, idx)); 1626builder.Append(remaining.Slice(0, idx)); 2192if (currentSepLength == 1 || source.Slice(i, currentSepLength).SequenceEqual(separator))
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\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\libraries\System.Private.CoreLib\src\System\Text\DecoderNLS.cs (1)
206MemoryMarshal.AsBytes(new ReadOnlySpan<int>(in _leftoverBytes)).Slice(0, _leftoverByteCount);
src\libraries\System.Private.CoreLib\src\System\Text\SpanLineEnumerator.cs (1)
66_current = remaining.Slice(0, idx);
src\libraries\System.Private.CoreLib\src\System\Text\StringBuilder.cs (2)
1555Append(remainder.Slice(0, countUntilNextBrace)); 2040if (!chunk.EqualsOrdinal(span.Slice(span.Length - offset, chunk_length)))
src\libraries\System.Private.CoreLib\src\System\Text\ValueStringBuilder.AppendFormat.cs (1)
50Append(remainder.Slice(0, countUntilNextBrace));
src\libraries\System.Private.CoreLib\src\System\TimeZoneInfo.Unix.cs (3)
980if (int.TryParse(dateRule.Slice(1, monthWeekDotIndex - 1), out month) && 981int.TryParse(weekDaySpan.Slice(0, weekDayDotIndex), out week) && 1099return posixFormat.Slice(startIndex, index - startIndex);
src\libraries\System.Private.CoreLib\src\System\Type.Helpers.cs (1)
513str = str.Slice(0, str.Length - 1);
src\libraries\System.Private.CoreLib\src\System\UInt128.cs (1)
895if ((source.Length > Size) && (source[Size..].ContainsAnyExcept((byte)0x00)))
src\libraries\System.Private.CoreLib\src\System\UInt16.cs (1)
359if ((source.Length > sizeof(ushort)) && (source[sizeof(ushort)..].ContainsAnyExcept((byte)0x00)))
src\libraries\System.Private.CoreLib\src\System\UInt32.cs (1)
387if ((source.Length > sizeof(uint)) && (source[sizeof(uint)..].ContainsAnyExcept((byte)0x00)))
src\libraries\System.Private.CoreLib\src\System\UInt64.cs (1)
386if ((source.Length > sizeof(ulong)) && (source[sizeof(ulong)..].ContainsAnyExcept((byte)0x00)))
src\libraries\System.Private.CoreLib\src\System\UIntPtr.cs (1)
390if ((source.Length > sizeof(nuint_t)) && (source[sizeof(nuint_t)..].ContainsAnyExcept((byte)0x00)))
src\libraries\System.Private.CoreLib\src\System\Version.cs (3)
390if (!TryParseComponent(input.Slice(0, majorEnd), nameof(input), throwOnFailure, out int major)) 398if (!TryParseComponent(input.Slice(majorEnd + 1, minorEnd - majorEnd - 1), nameof(input), throwOnFailure, out minor)) 407TryParseComponent(input.Slice(minorEnd + 1, buildEnd - minorEnd - 1), nameof(build), throwOnFailure, out build) &&
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\libraries\System.Reflection.Metadata\src\System\Reflection\Metadata\TypeNameParser.cs (1)
85ReadOnlySpan<char> fullTypeName = _inputString.Slice(0, fullTypeNameLength);
src\libraries\System.Reflection.Metadata\src\System\Reflection\Metadata\TypeNameParserHelpers.cs (2)
149return offset < 0 ? input : input.Slice(0, offset); 254if (length > 1 && input[0] == '.' && input.Slice(0, length).LastIndexOf('.') == 0)
src\System\Reflection\RuntimeCustomAttributeData.cs (1)
925private ReadOnlySpan<byte> PeekData(int size) => _blob.Slice(_curr, size);
src\System\StubHelpers.cs (1)
454managed.Slice(0, numChars).CopyTo(native);
System.Private.DataContractSerialization (10)
System\Runtime\Serialization\Json\JsonEncodingStreamWrapper.cs (1)
267int 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 (12)
src\libraries\Common\src\System\Net\IPv6AddressHelper.Common.cs (1)
344scopeId = address.Slice(scopeStart, i - scopeStart);
System\DomainNameHelper.cs (3)
112hostname = hostname.Slice(0, invalidCharOrDelimiterIndex); 152ReadOnlySpan<char> label = hostname.Slice(0, labelLength); 239label = label.Slice(0, dotIndex);
System\Uri.cs (2)
4359str.Slice(_info.Offset.Path, _info.Offset.Query - _info.Offset.Path), 4750share = share.Slice(0, i + 1);
System\UriExt.cs (2)
615string result = string.Concat(charsToUnescape.Slice(0, indexOfFirstToUnescape), vsb.AsSpan()); 670charsToUnescape.Slice(0, indexOfFirstToUnescape).CopyTo(destination);
System\UriHelper.cs (4)
175charsToEscape.Slice(0, indexOfFirstToEscape).CopyTo(destination); 226string result = string.Concat(charsToEscape.Slice(0, indexOfFirstToEscape), vsb.AsSpan()); 244dest.Append(stringToEscape.Slice(0, indexOfFirstToEscape)); 315vsb.Append(stringToEscape.Slice(0, charsToCopy));
System.Private.Windows.Core (2)
System\SpanReader.cs (2)
31set => _unread = Span[value..]; 240public void Advance(int count) => _unread = _unread[count..];
System.Private.Xml (3)
System\Xml\Core\XmlTextEncoder.cs (1)
293_textWriter.Write(text.Slice(startPos, i - startPos));
System\Xml\Serialization\XmlSerializationWriter.cs (1)
416Debug.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\libraries\Common\src\System\Reflection\AssemblyNameParser.cs (1)
266attributeValueSpan[parts[i]],
System\Reflection\Metadata\BlobBuilder.cs (1)
676buffer.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)
149return 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 (27)
System\Number.BigInteger.cs (8)
155value = value[whiteIndex..]; 193value = value[leadingBitsCount..]; 203value = value[TParser.DigitsPerBlock..]; 346intDigits = intDigits.Slice(0, intDigitsEnd); 366uint.TryParse(intDigits.Slice(0, PowersOf1e9.MaxPartialDigits), out base1E9[di]); 448base1E9 = base1E9.Slice(0, BigIntegerCalculator.ActualLength(base1E9)); 473Recursive(powersOf1e9, powersOf1e9Index - 1, base1E9[multiplier1E9Length..], buffer); 1103return pow1E9.Slice(from, toExclusive - from);
System\Numerics\BigInteger.cs (1)
387value.Slice(0, wholeUInt32Count * 4).CopyTo(MemoryMarshal.AsBytes<uint>(val.AsSpan()));
System\Numerics\BigIntegerCalculator.DivRem.cs (8)
530left = left.Slice(0, ActualLength(left)); 548Divide(left.Slice(0, quotient.Length), right[0], quotient, ref carry); 614BurnikelZieglerD3n2n(left.Slice(right.Length), left.Slice(halfN, halfN), right, quotient.Slice(halfN), r1); 615BurnikelZieglerD3n2n(r1.Slice(0, right.Length), left.Slice(0, halfN), right, quotient.Slice(0, halfN), remainder); 636ReadOnlySpan<uint> b2 = right.Slice(0, n); 655ReadOnlySpan<uint> a2 = left12.Slice(0, n); 687left = left.Slice(0, ActualLength(left)); 688right = right.Slice(0, ActualLength(right));
System\Numerics\BigIntegerCalculator.FastReducer.cs (1)
112right = right.Slice(0, k);
System\Numerics\BigIntegerCalculator.SquMul.cs (4)
85ReadOnlySpan<uint> valueLow = value.Slice(0, n); 212ReadOnlySpan<uint> leftLow = left.Slice(0, n); 261ReadOnlySpan<uint> leftLow = left.Slice(0, n); 265ReadOnlySpan<uint> rightLow = right.Slice(0, n);
System\Numerics\BigIntegerCalculator.Utils.cs (2)
42right = right.Slice(0, left.Length); 48left = left.Slice(0, right.Length);
System\Numerics\Complex.cs (3)
2107if ((openBracket != 0) && (((style & NumberStyles.AllowLeadingWhite) == 0) || !s.Slice(0, openBracket).IsWhiteSpace())) 2116if (!double.TryParse(s.Slice(openBracket + 1, semicolon - openBracket - 1), style, provider, out double real)) 2129if (!double.TryParse(s.Slice(semicolon + 1, closeBracket - semicolon - 1), style, provider, out double imaginary))
System.Security.Cryptography.Pkcs (8)
src\libraries\Common\src\System\Security\Cryptography\Asn1Reader\AsnValueReader.cs (4)
46return _span.Slice(contentOffset, contentLength); 52return _span.Slice(0, consumed); 171ReadOnlySpan<byte> content = _span.Slice(contentOffset, contentLength); 187ReadOnlySpan<byte> content = _span.Slice(contentOffset, contentLength);
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)
243ieeeSignature.Slice(0, fieldSize), 251ieeeSignature.Slice(fieldSize, fieldSize),
System.Security.Cryptography.ProtectedData (1)
src\libraries\Common\src\Interop\Windows\Kernel32\Interop.FormatMessage.cs (1)
84return 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 (86)
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)
1474return utf8Text.Slice(0, 0) == default; 1504return text.Slice(0, 0) == default;
System\Text\Json\JsonHelpers.cs (8)
374leftMiddle = leftFractional.Slice(0, -diff); 377rightFirst = rightIntegral.Slice(0, rightOffset); 393leftFirst = leftIntegral.Slice(0, leftOffset); 397rightMiddle = rightFractional.Slice(0, diff); 453intg = span.Slice(0, i); 466frac = span.Slice(0, i); 486frac = frac.Slice(0, iz); 512intg = 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 (1)
33data = data.Slice(0, lastLineFeedIndex);
System\Text\Json\Reader\JsonReaderHelper.Unescaping.cs (4)
484if (!source.Slice(0, idx).TryCopyTo(destination)) 534bool result = Utf8Parser.TryParse(source.Slice(idx + 1, 4), out int scalar, out int bytesConsumed, 'x'); 557result = Utf8Parser.TryParse(source.Slice(idx + 3, 4), out int lowSurrogate, out bytesConsumed, 'x'); 622remaining.Slice(0, nextUnescapedSegmentLength).CopyTo(destination.Slice(written));
System\Text\Json\Reader\Utf8JsonReader.cs (15)
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); 1144ValueSpan = span.Slice(0, literal.Length); 1299ValueSpan = localBuffer.Slice(0, idx); 1398ValueSpan = data.Slice(0, idx); 1533ValueSpan = data.Slice(0, i); 2476(int newLines, int newLineIndex) = JsonReaderHelper.CountNewLines(localBuffer.Slice(0, idx)); 2529ValueSpan = _buffer.Slice(previousConsumed + 2, idx); 2547ValueSpan = _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\Schema\JsonSchemaExporter.cs (1)
491sb.Append(span.Slice(0, pos));
System\Text\Json\Serialization\Converters\Value\EnumConverter.cs (1)
325next = rest.Slice(0, i).TrimEnd();
System\Text\Json\Serialization\JsonSerializer.Read.Utf8JsonReader.cs (2)
365valueSpan = reader.OriginalSpan.Slice( 414valueSpan = readerSpan.Slice((int)reader.TokenStartIndex, payloadLength);
System\Text\Json\Serialization\Metadata\PropertyRef.cs (2)
656 => MemoryMarshal.Read<uint>(name) | ((ulong)MemoryMarshal.Read<ushort>(name.Slice(4, 2)) << 32), 667 => MemoryMarshal.Read<uint>(name) | ((ulong)MemoryMarshal.Read<ushort>(name.Slice(4, 2)) << 32) | ((ulong)name[6] << 48),
System\Text\Json\ThrowHelper.Serialization.cs (1)
361str.Slice(0, MaxLength).CopyTo(builder);
System\Text\Json\Writer\JsonWriterHelper.Escaping.cs (2)
114value.Slice(0, indexOfFirstByteToEscape).CopyTo(destination); 232value.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\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)
978i = inputSpan.Slice(runtextpos, len).IndexOf(ch);
System\Text\RegularExpressions\RegexNode.cs (2)
1275startingSpan = startingSpan.Slice(0, 1); 1291startingSpan = startingSpan.Slice(0, c);
System\Text\RegularExpressions\RegexParser.cs (1)
172vsb.Append(input.Slice(0, indexOfMetachar));
System.Text.RegularExpressions.Generator (4)
src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexCaseEquivalences.cs (1)
156equivalences = EquivalenceCasingValues.Slice(index3, count);
src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexNode.cs (2)
1275startingSpan = startingSpan.Slice(0, 1); 1291startingSpan = startingSpan.Slice(0, c);
src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexParser.cs (1)
172vsb.Append(input.Slice(0, indexOfMetachar));
System.Web.HttpUtility (1)
System\Web\Util\HttpEncoder.cs (1)
150vsb.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 (2)
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.Windows.Forms.UI.IntegrationTests (3)
Infra\ScreenRecordService.cs (3)
284ReadOnlySpan<uint> previousFrameLine = previousImageData.Slice(line * stridePixels, width); 285ReadOnlySpan<uint> currentFrameLine = currentImageData.Slice(line * stridePixels, width); 547for (ReadOnlySpan<byte> remaining = bytes; !remaining.IsEmpty; remaining = remaining[Math.Min(buffer.Length, remaining.Length)..])
System.Xaml (7)
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);
Test.Utilities (5)
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\Compilers\Core\Portable\InternalUtilities\StringTable.cs (1)
509if (!chunk.Span.Equals(array.AsSpan().Slice(chunkOffset, chunk.Length), StringComparison.Ordinal))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\ObjectWriter.cs (1)
375span.Slice(offset, segmentLength).CopyTo(buffer.AsSpan());
Text.Analyzers (4)
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\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\ObjectWriter.cs (1)
375span.Slice(offset, segmentLength).CopyTo(buffer.AsSpan());