1565 references to AsSpan
aspire (8)
Aspire.Cli.Tests (1)
Aspire.Dashboard (7)
Aspire.Hosting (3)
Aspire.Hosting.Azure.Kusto (1)
Aspire.Hosting.Docker.Tests (1)
dotnet (4)
dotnet-aot (1)
dotnet-watch (1)
GenerateDocumentationAndConfigFiles (10)
ILAssembler (6)
ILCompiler.Compiler (4)
ILCompiler.Diagnostics (2)
ILCompiler.ReadyToRun (5)
ILCompiler.TypeSystem (2)
illink (2)
ILLink.RoslynAnalyzer (11)
Microsoft.AspNetCore.Antiforgery (1)
Microsoft.AspNetCore.Authentication.Negotiate (1)
Microsoft.AspNetCore.Components (11)
Microsoft.AspNetCore.Components.AI (1)
Microsoft.AspNetCore.Components.Endpoints (7)
Microsoft.AspNetCore.Components.Server (3)
Microsoft.AspNetCore.Components.Web (2)
Microsoft.AspNetCore.Components.WebAssembly (1)
Microsoft.AspNetCore.Components.WebAssembly.Server (1)
Microsoft.AspNetCore.Components.WebView (1)
Microsoft.AspNetCore.DataProtection (1)
Microsoft.AspNetCore.Diagnostics.Middleware (1)
Microsoft.AspNetCore.Diagnostics.Middleware.PerformanceTests (7)
Microsoft.AspNetCore.Http.Abstractions (5)
Microsoft.AspNetCore.Http.Connections.Client (1)
Microsoft.AspNetCore.Http.Connections.Common (1)
Microsoft.AspNetCore.Http.Extensions (13)
UriHelper.cs (7)
232var pathBaseSpan = uriParts.pathBase.AsSpan();
242index = CopyTextToBuffer(buffer, index, uriParts.scheme.AsSpan());
243index = CopyTextToBuffer(buffer, index, Uri.SchemeDelimiter.AsSpan());
244index = CopyTextToBuffer(buffer, index, uriParts.host.AsSpan());
246index = CopyTextToBuffer(buffer, index, uriParts.path.AsSpan());
247index = CopyTextToBuffer(buffer, index, uriParts.query.AsSpan());
248_ = CopyTextToBuffer(buffer, index, uriParts.fragment.AsSpan());
Microsoft.AspNetCore.HttpLogging (2)
Microsoft.AspNetCore.HttpOverrides (1)
Microsoft.AspNetCore.Localization (1)
Microsoft.AspNetCore.Mvc.Core (1)
Microsoft.AspNetCore.Mvc.Razor (5)
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation (2)
Microsoft.AspNetCore.Mvc.RazorPages (2)
Microsoft.AspNetCore.OpenApi (2)
Microsoft.AspNetCore.Razor.Utilities.Shared (4)
Microsoft.AspNetCore.Rewrite (2)
Microsoft.AspNetCore.Routing (7)
Microsoft.AspNetCore.Server.HttpSys (4)
Microsoft.AspNetCore.Server.IIS (5)
Microsoft.AspNetCore.Server.Kestrel.Core (6)
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic (1)
Microsoft.AspNetCore.SignalR.Common (1)
Microsoft.AspNetCore.SignalR.Core (1)
Microsoft.AspNetCore.SignalR.Protocols.Json (1)
Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson (1)
Microsoft.AspNetCore.WebSockets (5)
Microsoft.AspNetCore.WebUtilities (2)
Microsoft.Build (46)
Microsoft.Build.Framework (22)
Microsoft.Build.Tasks.CodeAnalysis (5)
Microsoft.Build.Tasks.Core (3)
Microsoft.Build.Utilities.Core (2)
Microsoft.CodeAnalysis (19)
Microsoft.CodeAnalysis.Analyzers (10)
Microsoft.CodeAnalysis.AnalyzerUtilities (10)
Microsoft.CodeAnalysis.CodeStyle (7)
Microsoft.CodeAnalysis.CSharp (8)
Microsoft.CodeAnalysis.CSharp.NetAnalyzers (1)
Microsoft.CodeAnalysis.CSharp.Workspaces (5)
Microsoft.CodeAnalysis.Extensions.Package (2)
Microsoft.CodeAnalysis.Features (5)
Microsoft.CodeAnalysis.NetAnalyzers (3)
Microsoft.CodeAnalysis.Razor.Compiler (59)
Language\Extensions\ViewCssScopePass.cs (11)
60var content = token.Content.AsSpan();
86return !content.StartsWith("/".AsSpan(), StringComparison.Ordinal)
87&& !content.StartsWith("!".AsSpan(), StringComparison.Ordinal)
88&& !content.Equals("head".AsSpan(), StringComparison.OrdinalIgnoreCase)
89&& !content.Equals("meta".AsSpan(), StringComparison.OrdinalIgnoreCase)
90&& !content.Equals("title".AsSpan(), StringComparison.OrdinalIgnoreCase)
91&& !content.Equals("link".AsSpan(), StringComparison.OrdinalIgnoreCase)
92&& !content.Equals("base".AsSpan(), StringComparison.OrdinalIgnoreCase)
93&& !content.Equals("script".AsSpan(), StringComparison.OrdinalIgnoreCase)
94&& !content.Equals("style".AsSpan(), StringComparison.OrdinalIgnoreCase)
95&& !content.Equals("html".AsSpan(), StringComparison.OrdinalIgnoreCase);
Microsoft.CodeAnalysis.ResxSourceGenerator (10)
Microsoft.CodeAnalysis.Workspaces (19)
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (1)
Microsoft.Data.Analysis (1)
Microsoft.Diagnostics.DataContractReader.Contracts (3)
Microsoft.Diagnostics.DataContractReader.Legacy (3)
Microsoft.Diagnostics.NETCore.Client (1)
Microsoft.DotNet.ProjectTools (1)
Microsoft.Extensions.AI.Abstractions (6)
Microsoft.Extensions.AI.Evaluation.NLP (5)
Microsoft.Extensions.AI.Evaluation.Quality (1)
Microsoft.Extensions.AI.OpenAI (1)
Microsoft.Extensions.Caching.Hybrid (6)
Microsoft.Extensions.Compliance.Abstractions (9)
Microsoft.Extensions.Compliance.Abstractions.Tests (8)
Redaction\RedactorTest.cs (7)
20Assert.Equal(string.Empty, r.Redact(string.Empty.AsSpan()));
23Assert.True(r.TryRedact<object?>(null, new char[0], out _, string.Empty.AsSpan()));
248Assert.Equal(success, r.TryRedact(data, buffer, out int charsWritten, string.Empty.AsSpan(), null));
266Assert.Equal(success, r.TryRedact(data, buffer, out int charsWritten, string.Empty.AsSpan(), null));
284Assert.Equal(success, r.TryRedact(data, buffer, out int charsWritten, "R".AsSpan(), null));
298Assert.True(r.TryRedact(Array.Empty<char>(), buffer, out int charsWritten, string.Empty.AsSpan(), null));
314Assert.True(r.TryRedact(new char[0], buffer, out int charsWritten, string.Empty.AsSpan(), null));
Microsoft.Extensions.Compliance.Redaction (1)
Microsoft.Extensions.Compliance.Redaction.Tests (1)
Microsoft.Extensions.Compliance.Testing (1)
Microsoft.Extensions.Configuration (2)
Microsoft.Extensions.Configuration.Binder.SourceGeneration (1)
Microsoft.Extensions.DataIngestion (7)
Microsoft.Extensions.DataIngestion.Markdig (1)
Microsoft.Extensions.DataIngestion.MarkItDown (1)
Microsoft.Extensions.Diagnostics (6)
Microsoft.Extensions.Diagnostics.ResourceMonitoring (4)
Microsoft.Extensions.Diagnostics.ResourceMonitoring.Tests (1)
Microsoft.Extensions.FileProviders.Physical (5)
Microsoft.Extensions.Http.Diagnostics (12)
Microsoft.Extensions.Identity.Core (1)
Microsoft.Extensions.Identity.Stores (1)
Microsoft.Extensions.Logging (3)
Microsoft.Extensions.Logging.Console (2)
Microsoft.Extensions.Logging.Generators (5)
Microsoft.Extensions.Logging.MSBuild (3)
Microsoft.Extensions.Primitives (4)
Microsoft.Extensions.ServiceDiscovery.Abstractions (1)
Microsoft.Extensions.ServiceDiscovery.Dns (1)
Microsoft.Extensions.ServiceDiscovery.Dns.Tests (1)
Microsoft.Extensions.Telemetry (13)
Microsoft.Extensions.Telemetry.Tests (3)
Microsoft.Gen.Logging.Generated.Tests (1)
Microsoft.Maui.Controls.Xaml (2)
Microsoft.Maui.Graphics (9)
Microsoft.ML.Core (4)
Microsoft.ML.IntegrationTests (1)
Microsoft.ML.StandardTrainers (1)
Microsoft.ML.Tokenizers (75)
Tokenizer.cs (9)
68=> EncodeToIds(text, text.AsSpan(), new EncodeSettings { ConsiderPreTokenization = considerPreTokenization, ConsiderNormalization = considerNormalization }).Tokens;
92EncodeResults<int> result = EncodeToIds(text, text.AsSpan(),
150EncodeResults<EncodedToken> result = EncodeToTokens(text, text.AsSpan(), new EncodeSettings { ConsiderPreTokenization = considerPreTokenization, ConsiderNormalization = considerNormalization });
194=> CountTokens(text, text.AsSpan(), new EncodeSettings { ConsiderPreTokenization = considerPreTokenization, ConsiderNormalization = considerNormalization });
278text.AsSpan(),
324text.AsSpan(),
446textSpanToEncode = normalizedText.AsSpan();
468textSpanToEncode = normalizedText.AsSpan();
477textSpanToEncode = text.AsSpan();
Microsoft.ML.Tokenizers.Tests (161)
BpeTests.cs (7)
476IReadOnlyList<EncodedToken> encoding1 = tokenizer.EncodeToTokens(text.AsSpan(), out _);
487Assert.Equal(expectedIds, tokenizer.EncodeToIds(text.AsSpan()));
491Assert.Equal(expectedIds, tokenizer.EncodeToIds(text.AsSpan(), expectedIds.Length, out normalizedText, out length));
499Assert.Equal(expectedIds.Take(expectedIds.Length - 2), tokenizer.EncodeToIds(text.AsSpan(), expectedIds.Length - 2, out normalizedText, out length));
504Assert.Equal(expectedIds.Length, tokenizer.CountTokens(text.AsSpan()));
509Assert.Equal(expectedOffsets[expectedOffsets.Length - 4].Index + expectedOffsets[expectedOffsets.Length - 4].Length, tokenizer.GetIndexByTokenCount(text.AsSpan(), expectedIds.Length - 3, out normalizedText, out tokenCount));
516Assert.Equal(expectedOffsets[expectedOffsets.Length - 3].Index, tokenizer.GetIndexByTokenCountFromEnd(text.AsSpan(), 3, out normalizedText, out tokenCount));
CodeGenTests.cs (84)
255encoding = tokenizer.EncodeToTokens(text.AsSpan(), out _);
263encoding = codeGenTokenizer.EncodeToTokens(text.AsSpan(), addPrefixSpace: codeGenTokenizer.AddPrefixSpace, addBeginningOfSentence: true, addEndOfSentence: false, out _);
271encoding = codeGenTokenizer.EncodeToTokens(text.AsSpan(), addPrefixSpace: codeGenTokenizer.AddPrefixSpace, addBeginningOfSentence: false, addEndOfSentence: true, out _);
279encoding = codeGenTokenizer.EncodeToTokens(text.AsSpan(), addPrefixSpace: codeGenTokenizer.AddPrefixSpace, addBeginningOfSentence: true, addEndOfSentence: true, out _);
287encoding = codeGenTokenizer.EncodeToTokens(text.AsSpan(), addPrefixSpace: true, addBeginningOfSentence: true, addEndOfSentence: true, out _);
296encoding = codeGenTokenizer.EncodeToTokens(text.AsSpan(), addPrefixSpace: true, addBeginningOfSentence: true, addEndOfSentence: true, out _);
350encoding = tokenizer.EncodeToTokens(text.AsSpan(), out _);
356encoding = codeGenTokenizer.EncodeToTokens(text.AsSpan(), addPrefixSpace: false, addBeginningOfSentence: false, addEndOfSentence: false, out _);
362encoding = codeGenTokenizer.EncodeToTokens(text.AsSpan(), addPrefixSpace: true, addBeginningOfSentence: false, addEndOfSentence: false, out _);
372Assert.Equal(ids, tokenizer.EncodeToIds(text.AsSpan()));
375Assert.Equal(expectedIdsWithSpace, codeGenTokenizer.EncodeToIds(text.AsSpan(), addPrefixSpace: true, addBeginningOfSentence: false, addEndOfSentence: false));
377Assert.Equal(expectedIds, codeGenTokenizer.EncodeToIds(text.AsSpan(), addPrefixSpace: false, addBeginningOfSentence: false, addEndOfSentence: false));
382Assert.Equal(ids, codeGenTokenizer.EncodeToIds(text.AsSpan(), ids.Length, out normalizedText, out length));
389Assert.Equal(expectedIds, codeGenTokenizer.EncodeToIds(text.AsSpan(), expectedIds.Length, addPrefixSpace: false, addBeginningOfSentence: false, addEndOfSentence: false, out normalizedText, out length));
396Assert.Equal(expectedIdsWithSpace, codeGenTokenizer.EncodeToIds(text.AsSpan(), expectedIdsWithSpace.Length, addPrefixSpace: true, addBeginningOfSentence: false, addEndOfSentence: false, out normalizedText, out length));
406Assert.Equal(ids.Take(ids.Length - expectedTokensToExclude), codeGenTokenizer.EncodeToIds(text.AsSpan(), ids.Length - 1, out normalizedText, out length));
413Assert.Equal(expectedIds.Take(expectedIds.Length - expectedTokensToExclude), codeGenTokenizer.EncodeToIds(text.AsSpan(), expectedIds.Length - 1, addPrefixSpace: false, addBeginningOfSentence: false, addEndOfSentence: false, out normalizedText, out length));
420Assert.Equal(expectedIdsWithSpace.Take(expectedIdsWithSpace.Length - expectedTokensToExclude), codeGenTokenizer.EncodeToIds(text.AsSpan(), expectedIdsWithSpace.Length - 1, addPrefixSpace: true, addBeginningOfSentence: false, addEndOfSentence: false, out normalizedText, out length));
429Assert.Equal(ids.Length, codeGenTokenizer.CountTokens(text.AsSpan()));
432Assert.Equal(expectedIds.Length, codeGenTokenizer.CountTokens(text.AsSpan(), addPrefixSpace: false, addBeginningOfSentence: false, addEndOfSentence: false));
435Assert.Equal(expectedIdsWithSpace.Length, codeGenTokenizer.CountTokens(text.AsSpan(), addPrefixSpace: true, addBeginningOfSentence: false, addEndOfSentence: false));
446Assert.Equal(offsets[offsets.Length - 1].Index + offsets[offsets.Length - 1].Length, codeGenTokenizer.GetIndexByTokenCount(text.AsSpan(), ids.Length, out normalizedText, out tokenCount));
453Assert.Equal(expectedOffsets[expectedOffsets.Length - 1].Index + expectedOffsets[expectedOffsets.Length - 1].Length, codeGenTokenizer.GetIndexByTokenCount(text.AsSpan(), expectedIds.Length, addPrefixSpace: false, addBeginningOfSentence: false, addEndOfSentence: false, out normalizedText, out tokenCount));
460Assert.Equal(expectedOffsetsWithSpace[expectedOffsetsWithSpace.Length - 1].Index + expectedOffsetsWithSpace[expectedOffsetsWithSpace.Length - 1].Length, codeGenTokenizer.GetIndexByTokenCount(text.AsSpan(), expectedIdsWithSpace.Length, addPrefixSpace: true, addBeginningOfSentence: false, addEndOfSentence: false, out normalizedText, out tokenCount));
473Assert.Equal(expectedIndex, codeGenTokenizer.GetIndexByTokenCountFromEnd(text.AsSpan(), 1, out normalizedText, out tokenCount));
480Assert.Equal(expectedIndex, codeGenTokenizer.GetIndexByTokenCountFromEnd(text.AsSpan(), 1, addPrefixSpace: false, addBeginningOfSentence: false, addEndOfSentence: false, out normalizedText, out tokenCount));
489Assert.Equal(expectedIndex, codeGenTokenizer.GetIndexByTokenCountFromEnd(text.AsSpan(), 1, addPrefixSpace: true, addBeginningOfSentence: false, addEndOfSentence: false, out normalizedText, out tokenCount));
560encoding = codeGenTokenizer.EncodeToTokens(text.AsSpan(), out _);
570encoding = codeGenTokenizer.EncodeToTokens(text.AsSpan(), addPrefixSpace: false, addBeginningOfSentence: true, addEndOfSentence: false, out _);
584encoding = codeGenTokenizer.EncodeToTokens(text.AsSpan(), addPrefixSpace: true, addBeginningOfSentence: true, addEndOfSentence: false, out _);
594encoding = codeGenTokenizer.EncodeToTokens(text.AsSpan(), addPrefixSpace: false, addBeginningOfSentence: false, addEndOfSentence: false, out _);
604encoding = codeGenTokenizer.EncodeToTokens(text.AsSpan(), addPrefixSpace: true, addBeginningOfSentence: false, addEndOfSentence: false, out _);
611ids = codeGenTokenizer.EncodeToIds(text.AsSpan());
615ids = codeGenTokenizer.EncodeToIds(text.AsSpan(), addPrefixSpace: false, addBeginningOfSentence: true, addEndOfSentence: false);
619ids = codeGenTokenizer.EncodeToIds(text.AsSpan(), addPrefixSpace: false, addBeginningOfSentence: false, addEndOfSentence: false);
623ids = codeGenTokenizer.EncodeToIds(text.AsSpan(), maxTokenCount: 5, addPrefixSpace: false, addBeginningOfSentence: true, addEndOfSentence: false, out normalizedText, out charsConsumed);
627int count = codeGenTokenizer.CountTokens(text.AsSpan(), addPrefixSpace: false, addBeginningOfSentence: false, addEndOfSentence: false);
631count = codeGenTokenizer.CountTokens(text.AsSpan());
635count = codeGenTokenizer.CountTokens(text.AsSpan(), addPrefixSpace: false, addBeginningOfSentence: true, addEndOfSentence: false);
641length = codeGenTokenizer.GetIndexByTokenCount(text.AsSpan(), maxTokenCount: 500, out normalizedText, out count);
647length = codeGenTokenizer.GetIndexByTokenCount(text.AsSpan(), maxTokenCount: 500, addPrefixSpace: false, addBeginningOfSentence: true, addEndOfSentence: false, out normalizedText, out count);
653length = codeGenTokenizer.GetIndexByTokenCount(text.AsSpan(), maxTokenCount: 500, addPrefixSpace: false, addBeginningOfSentence: false, addEndOfSentence: false, out normalizedText, out count);
660index = codeGenTokenizer.GetIndexByTokenCountFromEnd(text.AsSpan(), maxTokenCount: 500, out normalizedText, out count);
666index = codeGenTokenizer.GetIndexByTokenCountFromEnd(text.AsSpan(), maxTokenCount: 500, addPrefixSpace: false, addBeginningOfSentence: true, addEndOfSentence: false, out normalizedText, out count);
672index = codeGenTokenizer.GetIndexByTokenCountFromEnd(text.AsSpan(), maxTokenCount: 500, addPrefixSpace: false, addBeginningOfSentence: false, addEndOfSentence: false, out normalizedText, out count);
693encoding = codeGenTokenizer.EncodeToTokens(text.AsSpan(), out _);
703encoding = codeGenTokenizer.EncodeToTokens(text.AsSpan(), addPrefixSpace: false, addBeginningOfSentence: false, addEndOfSentence: true, out _);
717encoding = codeGenTokenizer.EncodeToTokens(text.AsSpan(), addPrefixSpace: true, addBeginningOfSentence: false, addEndOfSentence: true, out _);
727encoding = codeGenTokenizer.EncodeToTokens(text.AsSpan(), addPrefixSpace: false, addBeginningOfSentence: false, addEndOfSentence: false, out _);
737encoding = codeGenTokenizer.EncodeToTokens(text.AsSpan(), addPrefixSpace: true, addBeginningOfSentence: false, addEndOfSentence: false, out _);
744ids = codeGenTokenizer.EncodeToIds(text.AsSpan());
748ids = codeGenTokenizer.EncodeToIds(text.AsSpan(), addPrefixSpace: false, addBeginningOfSentence: false, addEndOfSentence: true);
752ids = codeGenTokenizer.EncodeToIds(text.AsSpan(), addPrefixSpace: false, addBeginningOfSentence: false, addEndOfSentence: false);
756ids = codeGenTokenizer.EncodeToIds(text.AsSpan(), maxTokenCount: 500, addPrefixSpace: false, addBeginningOfSentence: false, addEndOfSentence: true, out normalizedText, out charsConsumed);
760count = codeGenTokenizer.CountTokens(text.AsSpan(), addPrefixSpace: false, addBeginningOfSentence: false, addEndOfSentence: false);
764count = codeGenTokenizer.CountTokens(text.AsSpan());
768count = codeGenTokenizer.CountTokens(text.AsSpan(), addPrefixSpace: false, addBeginningOfSentence: false, addEndOfSentence: true);
774length = codeGenTokenizer.GetIndexByTokenCount(text.AsSpan(), maxTokenCount: 500, out normalizedText, out count);
780length = codeGenTokenizer.GetIndexByTokenCount(text.AsSpan(), maxTokenCount: 500, addPrefixSpace: false, addBeginningOfSentence: false, addEndOfSentence: true, out normalizedText, out count);
786length = codeGenTokenizer.GetIndexByTokenCount(text.AsSpan(), maxTokenCount: 500, addPrefixSpace: false, addBeginningOfSentence: false, addEndOfSentence: false, out normalizedText, out count);
793index = codeGenTokenizer.GetIndexByTokenCountFromEnd(text.AsSpan(), maxTokenCount: 500, out normalizedText, out count);
799index = codeGenTokenizer.GetIndexByTokenCountFromEnd(text.AsSpan(), maxTokenCount: 500, addPrefixSpace: false, addBeginningOfSentence: false, addEndOfSentence: true, out normalizedText, out count);
805index = codeGenTokenizer.GetIndexByTokenCountFromEnd(text.AsSpan(), maxTokenCount: 500, addPrefixSpace: false, addBeginningOfSentence: false, addEndOfSentence: false, out normalizedText, out count);
829encoding = codeGenTokenizer.EncodeToTokens(text.AsSpan(), out _);
841encoding = codeGenTokenizer.EncodeToTokens(text.AsSpan(), addPrefixSpace: false, addBeginningOfSentence: true, addEndOfSentence: true, out _);
859encoding = codeGenTokenizer.EncodeToTokens(text.AsSpan(), addPrefixSpace: true, addBeginningOfSentence: true, addEndOfSentence: true, out _);
871encoding = codeGenTokenizer.EncodeToTokens(text.AsSpan(), addPrefixSpace: false, addBeginningOfSentence: false, addEndOfSentence: false, out _);
883encoding = codeGenTokenizer.EncodeToTokens(text.AsSpan(), addPrefixSpace: true, addBeginningOfSentence: false, addEndOfSentence: false, out _);
892ids = codeGenTokenizer.EncodeToIds(text.AsSpan());
898ids = codeGenTokenizer.EncodeToIds(text.AsSpan(), addPrefixSpace: false, addBeginningOfSentence: true, addEndOfSentence: true);
904ids = codeGenTokenizer.EncodeToIds(text.AsSpan(), addPrefixSpace: false, addBeginningOfSentence: false, addEndOfSentence: false);
910ids = codeGenTokenizer.EncodeToIds(text.AsSpan(), maxTokenCount: 500, addPrefixSpace: false, addBeginningOfSentence: true, addEndOfSentence: true, out normalizedText, out charsConsumed);
915count = codeGenTokenizer.CountTokens(text.AsSpan(), addPrefixSpace: false, addBeginningOfSentence: false, addEndOfSentence: false);
919count = codeGenTokenizer.CountTokens(text.AsSpan());
923count = codeGenTokenizer.CountTokens(text.AsSpan(), addPrefixSpace: false, addBeginningOfSentence: true, addEndOfSentence: true);
928length = codeGenTokenizer.GetIndexByTokenCount(text.AsSpan(), maxTokenCount: 500, out normalizedText, out count);
934length = codeGenTokenizer.GetIndexByTokenCount(text.AsSpan(), maxTokenCount: 500, addPrefixSpace: false, addBeginningOfSentence: true, addEndOfSentence: true, out normalizedText, out count);
940length = codeGenTokenizer.GetIndexByTokenCount(text.AsSpan(), maxTokenCount: 500, addPrefixSpace: false, addBeginningOfSentence: false, addEndOfSentence: false, out normalizedText, out count);
947index = codeGenTokenizer.GetIndexByTokenCountFromEnd(text.AsSpan(), maxTokenCount: 500, out normalizedText, out count);
953index = codeGenTokenizer.GetIndexByTokenCountFromEnd(text.AsSpan(), maxTokenCount: 500, addPrefixSpace: false, addBeginningOfSentence: true, addEndOfSentence: true, out normalizedText, out count);
959index = codeGenTokenizer.GetIndexByTokenCountFromEnd(text.AsSpan(), maxTokenCount: 500, addPrefixSpace: false, addBeginningOfSentence: false, addEndOfSentence: false, out normalizedText, out count);
1002ids = _codegen350MMonoTokenizer.EncodeToIds(input.AsSpan(), maxTokenCount, out _, out charsConsumed);
1012charsConsumed = _codegen350MMonoTokenizer.GetIndexByTokenCount(input.AsSpan(), maxTokenCount, out _, out tokenCount);
1022charsConsumed = _codegen350MMonoTokenizer.GetIndexByTokenCountFromEnd(input.AsSpan(), maxTokenCount, out _, out tokenCount);
EnglishRobertaTests.cs (7)
182IReadOnlyList<EncodedToken> encoding1 = tokenizer.EncodeToTokens(text.AsSpan(), out _);
193Assert.Equal(expectedIds, tokenizer.EncodeToIds(text.AsSpan()));
197Assert.Equal(expectedIds, tokenizer.EncodeToIds(text.AsSpan(), expectedIds.Length, out normalizedText, out length));
205Assert.Equal(expectedIds.Take(expectedIds.Length - 2), tokenizer.EncodeToIds(text.AsSpan(), expectedIds.Length - 2, out normalizedText, out length));
210Assert.Equal(expectedIds.Length, tokenizer.CountTokens(text.AsSpan()));
215Assert.Equal(expectedOffsets[expectedOffsets.Length - 4].Index + expectedOffsets[expectedOffsets.Length - 4].Length, tokenizer.GetIndexByTokenCount(text.AsSpan(), expectedIds.Length - 3, out normalizedText, out tokenCount));
222Assert.Equal(expectedOffsets[expectedOffsets.Length - 3].Index, tokenizer.GetIndexByTokenCountFromEnd(text.AsSpan(), 3, out normalizedText, out tokenCount));
LlamaTests.cs (34)
266IReadOnlyList<EncodedToken> bpeTokens = bpe.EncodeToTokens(normalizedInput.AsSpan(), out _, addBeginningOfSentence: false, addEndOfSentence: false, considerNormalization: false);
272IReadOnlyList<int> encodedIds = bpe.EncodeToIds(normalizedInput.AsSpan(), addBeginningOfSentence: false, addEndOfSentence: false, considerNormalization: false);
274Assert.Equal(isEmptyInput ? 0 : ids.Length - 1, bpe.CountTokens(normalizedInput.AsSpan(), addBeginningOfSentence: false, addEndOfSentence: false, considerNormalization: false));
276bpeTokens = bpe.EncodeToTokens(normalizedInput.AsSpan(), out _, addBeginningOfSentence: false, addEndOfSentence: true, considerNormalization: false);
282encodedIds = bpe.EncodeToIds(normalizedInput.AsSpan(), addBeginningOfSentence: false, addEndOfSentence: true, considerNormalization: false);
284Assert.Equal(isEmptyInput ? 0 : ids.Length, bpe.CountTokens(normalizedInput.AsSpan(), addBeginningOfSentence: false, addEndOfSentence: true, considerNormalization: false));
286bpeTokens = bpe.EncodeToTokens(normalizedInput.AsSpan(), out _, addBeginningOfSentence: true, addEndOfSentence: true, considerNormalization: false);
292encodedIds = bpe.EncodeToIds(normalizedInput.AsSpan(), addBeginningOfSentence: true, addEndOfSentence: true, considerNormalization: false);
294Assert.Equal(isEmptyInput ? 0 : ids.Length + 1, bpe.CountTokens(normalizedInput.AsSpan(), addBeginningOfSentence: true, addEndOfSentence: true, considerNormalization: false));
399Assert.Equal("Hello, World!", normalizer.Normalize("Hello, World!".AsSpan()));
403Assert.Equal("Hello, World!", normalizer.Normalize("Hello, World!".AsSpan()));
407Assert.Equal(" Hello, World!", normalizer.Normalize("Hello, World!".AsSpan()));
411Assert.Equal("▁Hello,▁World!", normalizer.Normalize("Hello, World!".AsSpan()));
415Assert.Equal("▁Hello,▁▁▁▁▁▁World!", normalizer.Normalize("Hello, World!".AsSpan()));
419Assert.Equal("Hello,▁World!▁", normalizer.Normalize("Hello, World!".AsSpan()));
423Assert.Equal("Hello,▁World!", normalizer.Normalize("Hello, World!".AsSpan()));
427Assert.Equal("Hello,▁▁▁▁▁▁World!▁", normalizer.Normalize("Hello, World!".AsSpan()));
431Assert.Equal("Hello, World! ", normalizer.Normalize("Hello, World!".AsSpan()));
501IReadOnlyList<EncodedToken> encoding1 = tokenizer.EncodeToTokens(text.AsSpan(), out _);
525considerNormalization ? text.AsSpan() : normalizedText.AsSpan(),
557Assert.Equal(expectedIds, tokenizer.EncodeToIds(text.AsSpan()));
561Assert.Equal(expectedIds, tokenizer.EncodeToIds(text.AsSpan(), expectedIds.Length, out normalizedString, out length));
585considerNormalization ? text.AsSpan() : normalizedText.AsSpan(),
612considerNormalization ? text.AsSpan() : normalizedText.AsSpan(),
633Assert.Equal(expectedIds.Length, tokenizer.CountTokens(text.AsSpan()));
638Assert.Equal(expectedOffsets[expectedOffsets.Length - 7].Index + expectedOffsets[expectedOffsets.Length - 7].Length, tokenizer.GetIndexByTokenCount(text.AsSpan(), expectedIds.Length - 6, out normalizedString, out tokenCount));
645Assert.Equal(expectedOffsets[expectedOffsets.Length - 7].Index, tokenizer.GetIndexByTokenCountFromEnd(text.AsSpan(), 7, out normalizedString, out tokenCount));
850Assert.True(decodedWithNoSpecialTokens.AsSpan().StartsWith(destinationBuffer.AsSpan().Slice(0, charactersWritten)));
864Assert.True(textWithSpecialTokens.AsSpan().StartsWith(destinationBuffer.AsSpan().Slice(0, charactersWritten)));
889Assert.True(decodedWithNoSpecialTokens.AsSpan().StartsWith(destinationBuffer.AsSpan().Slice(0, charactersWritten)));
908Assert.True(textWithSpecialTokens.AsSpan().StartsWith(sp));
TiktokenTests.cs (7)
639IReadOnlyList<EncodedToken> encoding1 = tokenizer.EncodeToTokens(text.AsSpan(), out _);
650Assert.Equal(expectedIds, tokenizer.EncodeToIds(text.AsSpan()));
654Assert.Equal(expectedIds, tokenizer.EncodeToIds(text.AsSpan(), expectedIds.Length, out normalizedText, out length));
662Assert.Equal(expectedIds.Take(expectedIds.Length - 4), tokenizer.EncodeToIds(text.AsSpan(), expectedIds.Length - 4, out normalizedText, out length));
667Assert.Equal(expectedIds.Length, tokenizer.CountTokens(text.AsSpan()));
672Assert.Equal(expectedOffsets[expectedOffsets.Length - 4].Index + expectedOffsets[expectedOffsets.Length - 4].Length, tokenizer.GetIndexByTokenCount(text.AsSpan(), expectedIds.Length - 3, out normalizedText, out tokenCount));
679Assert.Equal(expectedOffsets[expectedOffsets.Length - 3].Index, tokenizer.GetIndexByTokenCountFromEnd(text.AsSpan(), 3, out normalizedText, out tokenCount));
UnigramTests.cs (16)
333result = _unigramTokenizer.EncodeToTokens(inputText.AsSpan(), out normalized);
341result = _unigramTokenizer.EncodeToTokens(inputText.AsSpan(), out normalized, addBeginningOfSentence: true, addEndOfSentence: false);
349result = _unigramTokenizer.EncodeToTokens(inputText.AsSpan(), out normalized, addBeginningOfSentence: true, addEndOfSentence: true);
384result = _unigramTokenizer.EncodeToIds(inputText.AsSpan(), addBeginningOfSentence: false, addEndOfSentence: false);
395result = _unigramTokenizer.EncodeToIds(inputText.AsSpan(), addBeginningOfSentence: true, addEndOfSentence: false);
412result = _unigramTokenizer.EncodeToIds(inputText.AsSpan(), addBeginningOfSentence: true, addEndOfSentence: true);
427result = _unigramTokenizer.EncodeToIds(inputText.AsSpan(), addBeginningOfSentence: false, addEndOfSentence: false, maxTokenCount: i, out normalized, out charConsumed);
447result = _unigramTokenizer.EncodeToIds(inputText.AsSpan(), addBeginningOfSentence: true, addEndOfSentence: true, maxTokenCount: i, out normalized, out charConsumed);
479result = _unigramTokenizerWithSpecialTokens.EncodeToIds(inputText.AsSpan(), addBeginningOfSentence: false, addEndOfSentence: false, maxTokenCount: i, out normalized, out charConsumed);
503index = _unigramTokenizer.GetIndexByTokenCount(inputText.AsSpan(), addBeginningOfSentence: false, addEndOfSentence: false, maxTokenCount: 1, out normalized, out charConsumed);
505ids1 = _unigramTokenizer.EncodeToIds(normalized!.Substring(0, index).AsSpan(), addBeginningOfSentence: false, addEndOfSentence: false, considerNormalization: false);
506ids2 = index < normalized.Length ? _unigramTokenizer.EncodeToIds(normalized!.Substring(index).AsSpan(), addBeginningOfSentence: false, addEndOfSentence: false, considerNormalization: false) : new List<int>();
515index = _unigramTokenizer.GetIndexByTokenCountFromEnd(inputText.AsSpan(), addBeginningOfSentence: false, addEndOfSentence: false, maxTokenCount: 1, considerNormalization: true, out normalized, out charConsumed);
517ids1 = _unigramTokenizer.EncodeToIds(normalized!.Substring(0, index).AsSpan(), addBeginningOfSentence: false, addEndOfSentence: false, considerNormalization: false);
518ids2 = index < normalized.Length ? _unigramTokenizer.EncodeToIds(normalized!.Substring(index).AsSpan(), addBeginningOfSentence: false, addEndOfSentence: false, considerNormalization: false) : new List<int>();
551Assert.Equal(decodedString.AsSpan().Slice(0, charsWritten).ToString(), buffer.AsSpan().Slice(0, charsWritten).ToString());
Microsoft.ML.Transforms (1)
Microsoft.NET.Build.Tasks (1)
Microsoft.NET.Sdk.BlazorWebAssembly.Tasks (2)
Microsoft.NET.Sdk.StaticWebAssets.Tasks (15)
Microsoft.NET.StringTools (5)
Microsoft.Private.Windows.Core (7)
MSBuild (2)
NuGet.Commands (8)
NuGet.Packaging (4)
PresentationBuildTasks (6)
PresentationCore (4)
PresentationFramework (17)
ReachFramework (1)
ResultsOfTGenerator (1)
Roslyn.Diagnostics.Analyzers (10)
Shared (7)
System.CodeDom (2)
System.Collections.Immutable (21)
System.CommandLine (3)
System.ComponentModel.Annotations (2)
System.ComponentModel.TypeConverter (5)
System.Configuration.ConfigurationManager (3)
System.Data.Common (1)
System.Diagnostics.DiagnosticSource (10)
System.Diagnostics.Process (1)
System.DirectoryServices (1)
System.Drawing.Common (3)
System.Formats.Asn1 (3)
System.Formats.Cbor (1)
System.Formats.Nrbf (10)
System.Formats.Tar (12)
System.IO.Compression (2)
System.IO.FileSystem.AccessControl (16)
System.IO.FileSystem.Watcher (9)
System.IO.Packaging (2)
System.IO.Pipes (2)
System.Management (1)
System.Net.Http (5)
System.Net.Http.WinHttpHandler (7)
System.Net.HttpListener (3)
System.Net.Mail (7)
System.Net.NameResolution (2)
System.Net.NetworkInformation (4)
System.Net.Primitives (11)
System.Net.Requests (4)
System.Net.WebHeaderCollection (1)
System.Net.WebSockets (1)
System.Net.WebSockets.Client (1)
System.Private.CoreLib (222)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Byte.cs (3)
105return Parse(s.AsSpan(), style, provider);
127return Number.TryParseBinaryInteger(s.AsSpan(), style, NumberFormatInfo.GetInstance(provider), out result, out _) == Number.ParsingStatus.OK;
1105return Number.TryParseBinaryInteger(s.AsSpan(), style | Number.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out result, out charsConsumed) == Number.ParsingStatus.OK;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Convert.cs (11)
2062int r = ParseNumbers.StringToInt(value.AsSpan(), fromBase, ParseNumbers.IsTight | ParseNumbers.TreatAsUnsigned);
2085int r = ParseNumbers.StringToInt(value.AsSpan(), fromBase, ParseNumbers.IsTight | ParseNumbers.TreatAsI1);
2110int r = ParseNumbers.StringToInt(value.AsSpan(), fromBase, ParseNumbers.IsTight | ParseNumbers.TreatAsI2);
2136int r = ParseNumbers.StringToInt(value.AsSpan(), fromBase, ParseNumbers.IsTight | ParseNumbers.TreatAsUnsigned);
2153ParseNumbers.StringToInt(value.AsSpan(), fromBase, ParseNumbers.IsTight) :
2169(uint)ParseNumbers.StringToInt(value.AsSpan(), fromBase, ParseNumbers.TreatAsUnsigned | ParseNumbers.IsTight) :
2184ParseNumbers.StringToLong(value.AsSpan(), fromBase, ParseNumbers.IsTight) :
2200(ulong)ParseNumbers.StringToLong(value.AsSpan(), fromBase, ParseNumbers.TreatAsUnsigned | ParseNumbers.IsTight) :
2531return TryFromBase64Chars(s.AsSpan(), bytes, out bytesWritten);
2575return FromHexString(s.AsSpan());
2644return FromHexString(source.AsSpan(), destination, out charsConsumed, out bytesWritten);
src\runtime\src\libraries\System.Private.CoreLib\src\System\DateOnly.cs (9)
397return Parse(s.AsSpan(), provider, style);
422return ParseExact(s.AsSpan(), format.AsSpan(), provider, style);
446return ParseExact(s.AsSpan(), formats, provider, style);
687return TryParse(s.AsSpan(), provider, style, out result);
718return TryParseExact(s.AsSpan(), format.AsSpan(), provider, style, out result);
747return TryParseExact(s.AsSpan(), formats, provider, style, out result);
832DateTimeFormat.IsValidCustomDateOnlyFormat(format.AsSpan(), throwOnError: true);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Decimal.cs (3)
532return Parse(s.AsSpan(), style, provider);
554return Number.TryParseDecimal(s.AsSpan(), style, NumberFormatInfo.GetInstance(provider), out result, out _) == Number.ParsingStatus.OK;
1780return Number.TryParseDecimal(s.AsSpan(), style | Number.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out result, out charsConsumed) == Number.ParsingStatus.OK;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Double.cs (3)
402return Parse(s.AsSpan(), style, provider);
432return Number.TryParseFloat(s.AsSpan(), style, NumberFormatInfo.GetInstance(provider), out result, out _);
1502return Number.TryParseFloat(s.AsSpan(), style | Number.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out result, out charsConsumed);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Enum.cs (4)
583bool success = TryParse(enumType, value.AsSpan(), ignoreCase, throwOnFailure: true, out object? result);
645bool success = TryParse(value.AsSpan(), ignoreCase, throwOnFailure: true, out TEnum result);
696return TryParse(enumType, value.AsSpan(), ignoreCase, throwOnFailure: false, out result);
859return TryParse(value.AsSpan(), ignoreCase, throwOnFailure: false, out result);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\CompareInfo.cs (12)
128return IsSortable(text.AsSpan());
278return Compare(string1.AsSpan(), string2.AsSpan(), options);
512return IsPrefix(source.AsSpan(), prefix.AsSpan(), options);
655return IsSuffix(source.AsSpan(), suffix.AsSpan(), options);
822return IndexOf(source.AsSpan(), value.AsSpan(), options);
1155return LastIndexOf(source.AsSpan(), value.AsSpan(), options);
1537return GetHashCode(source.AsSpan(), options);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Half.cs (3)
366return Parse(s.AsSpan(), style, provider);
415return Number.TryParseFloat(s.AsSpan(), style, NumberFormatInfo.GetInstance(provider), out result, out _);
2225return Number.TryParseFloat(s.AsSpan(), style | Number.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out result, out charsConsumed);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Int128.cs (3)
138return Parse(s.AsSpan(), style, provider);
160return Number.TryParseBinaryInteger(s.AsSpan(), style, NumberFormatInfo.GetInstance(provider), out result, out _) == Number.ParsingStatus.OK;
1913return Number.TryParseBinaryInteger(s.AsSpan(), style | Number.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out result, out charsConsumed) == Number.ParsingStatus.OK;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Int16.cs (3)
138return Parse(s.AsSpan(), style, provider);
160return Number.TryParseBinaryInteger(s.AsSpan(), style, NumberFormatInfo.GetInstance(provider), out result, out _) == Number.ParsingStatus.OK;
1304return Number.TryParseBinaryInteger(s.AsSpan(), style | Number.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out result, out charsConsumed) == Number.ParsingStatus.OK;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Int32.cs (3)
154return Parse(s.AsSpan(), style, provider);
176return Number.TryParseBinaryInteger(s.AsSpan(), style, NumberFormatInfo.GetInstance(provider), out result, out _) == Number.ParsingStatus.OK;
1355return Number.TryParseBinaryInteger(s.AsSpan(), style | Number.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out result, out charsConsumed) == Number.ParsingStatus.OK;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Int64.cs (3)
151return Parse(s.AsSpan(), style, provider);
173return Number.TryParseBinaryInteger(s.AsSpan(), style, NumberFormatInfo.GetInstance(provider), out result, out _) == Number.ParsingStatus.OK;
1358return Number.TryParseBinaryInteger(s.AsSpan(), style | Number.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out result, out charsConsumed) == Number.ParsingStatus.OK;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\BFloat16.cs (3)
262return Parse(s.AsSpan(), style, provider);
311return Number.TryParseFloat(s.AsSpan(), style, NumberFormatInfo.GetInstance(provider), out result, out _);
1948return Number.TryParseFloat(s.AsSpan(), style | Number.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out result, out charsConsumed);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\Decimal128.cs (3)
171return Parse(s.AsSpan(), style, provider);
227return Number.TryParseDecimalIeee754<char, Decimal128, UInt128>(s.AsSpan(), style, NumberFormatInfo.GetInstance(provider), out result, out _) == Number.ParsingStatus.OK;
759return Number.TryParseDecimalIeee754<char, Decimal128, UInt128>(s.AsSpan(), style | Number.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out result, out charsConsumed) == Number.ParsingStatus.OK;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\Decimal32.cs (3)
163return Parse(s.AsSpan(), style, provider);
219return Number.TryParseDecimalIeee754<char, Decimal32, uint>(s.AsSpan(), style, NumberFormatInfo.GetInstance(provider), out result, out _) == Number.ParsingStatus.OK;
770return Number.TryParseDecimalIeee754<char, Decimal32, uint>(s.AsSpan(), style | Number.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out result, out charsConsumed) == Number.ParsingStatus.OK;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\Decimal64.cs (3)
172return Parse(s.AsSpan(), style, provider);
228return Number.TryParseDecimalIeee754<char, Decimal64, ulong>(s.AsSpan(), style, NumberFormatInfo.GetInstance(provider), out result, out _) == Number.ParsingStatus.OK;
763return Number.TryParseDecimalIeee754<char, Decimal64, ulong>(s.AsSpan(), style | Number.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out result, out charsConsumed) == Number.ParsingStatus.OK;
src\runtime\src\libraries\System.Private.CoreLib\src\System\SByte.cs (3)
141return Parse(s.AsSpan(), style, provider);
163return Number.TryParseBinaryInteger(s.AsSpan(), style, NumberFormatInfo.GetInstance(provider), out result, out _) == Number.ParsingStatus.OK;
1283return Number.TryParseBinaryInteger(s.AsSpan(), style | Number.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out result, out charsConsumed) == Number.ParsingStatus.OK;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Single.cs (3)
403return Parse(s.AsSpan(), style, provider);
425return Number.TryParseFloat(s.AsSpan(), style, NumberFormatInfo.GetInstance(provider), out result, out _);
1519return Number.TryParseFloat(s.AsSpan(), style | Number.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out result, out charsConsumed);
src\runtime\src\libraries\System.Private.CoreLib\src\System\String.Manipulation.cs (14)
770return JoinCore(separator.AsSpan(), new ReadOnlySpan<string?>(value));
785return JoinCore(separator.AsSpan(), value);
792JoinCore(separator.AsSpan(), value, startIndex, count);
808return JoinCore(separator.AsSpan(), CollectionsMarshal.AsSpan(valuesList));
813return JoinCore(separator.AsSpan(), new ReadOnlySpan<string?>(valuesArray));
882return JoinCore(separator.AsSpan(), (ReadOnlySpan<object?>)values);
896JoinCore(separator.AsSpan(), values);
933JoinCore(separator.AsSpan(), values);
1235return ReplaceCore(this, oldValue.AsSpan(), newValue.AsSpan(), ci ?? CultureInfo.CurrentCulture.CompareInfo, options)
1649int idxOfFirstNewlineChar = this.AsSpan().IndexOfAny(SearchValuesStorage.NewLineCharsExceptLineFeed);
1920=> Split(separator.AsSpan(), count, options);
2644? this.AsSpan().IndexOfAnyExcept(SearchValuesStorage.AsciiExceptLowercase)
2645: this.AsSpan().IndexOfAnyExcept(SearchValuesStorage.AsciiExceptUppercase);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\StringBuilder.cs (4)
958public StringBuilder Insert(int index, string? value, int count) => Insert(index, value.AsSpan(), count);
1348public StringBuilder Insert(int index, bool value) => Insert(index, value.ToString().AsSpan(), 1);
2116return Replace(oldValue.AsSpan(), newValue.AsSpan(), startIndex, count);
src\runtime\src\libraries\System.Private.CoreLib\src\System\TimeOnly.cs (9)
565return Parse(s.AsSpan(), provider, style);
590return ParseExact(s.AsSpan(), format.AsSpan(), provider, style);
614return ParseExact(s.AsSpan(), formats, provider, style);
856return TryParse(s.AsSpan(), provider, style, out result);
887return TryParseExact(s.AsSpan(), format.AsSpan(), provider, style, out result);
916return TryParseExact(s.AsSpan(), formats, provider, style, out result);
1003DateTimeFormat.IsValidCustomTimeOnlyFormat(format.AsSpan(), throwOnError: true);
src\runtime\src\libraries\System.Private.CoreLib\src\System\UInt128.cs (3)
140return Parse(s.AsSpan(), style, provider);
162return Number.TryParseBinaryInteger(s.AsSpan(), style, NumberFormatInfo.GetInstance(provider), out result, out _) == Number.ParsingStatus.OK;
2034return Number.TryParseBinaryInteger(s.AsSpan(), style | Number.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out result, out charsConsumed) == Number.ParsingStatus.OK;
src\runtime\src\libraries\System.Private.CoreLib\src\System\UInt16.cs (3)
133return Parse(s.AsSpan(), style, provider);
155return Number.TryParseBinaryInteger(s.AsSpan(), style, NumberFormatInfo.GetInstance(provider), out result, out _) == Number.ParsingStatus.OK;
1110return Number.TryParseBinaryInteger(s.AsSpan(), style | Number.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out result, out charsConsumed) == Number.ParsingStatus.OK;
src\runtime\src\libraries\System.Private.CoreLib\src\System\UInt32.cs (3)
149return Parse(s.AsSpan(), style, provider);
171return Number.TryParseBinaryInteger(s.AsSpan(), style, NumberFormatInfo.GetInstance(provider), out result, out _) == Number.ParsingStatus.OK;
1181return Number.TryParseBinaryInteger(s.AsSpan(), style | Number.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out result, out charsConsumed) == Number.ParsingStatus.OK;
src\runtime\src\libraries\System.Private.CoreLib\src\System\UInt64.cs (3)
148return Parse(s.AsSpan(), style, provider);
170return Number.TryParseBinaryInteger(s.AsSpan(), style, NumberFormatInfo.GetInstance(provider), out result, out _) == Number.ParsingStatus.OK;
1182return Number.TryParseBinaryInteger(s.AsSpan(), style | Number.AllowTrailingInvalidCharacters, NumberFormatInfo.GetInstance(provider), out result, out charsConsumed) == Number.ParsingStatus.OK;
System.Private.DataContractSerialization (4)
System.Private.Uri (7)
System.Private.Windows.Core (6)
System.Private.Xml (29)
System.Private.Xml.Linq (2)
System.Reflection.Metadata (8)
System.Reflection.MetadataLoadContext (1)
System.Resources.Extensions (4)
System.Runtime.Numerics (9)
System\Numerics\BigInteger.cs (3)
816return Parse(value.AsSpan(), style, provider);
826return TryParse(value.AsSpan(), style, provider, out result);
862return Number.TryParseBigIntegerPartial(MemoryMarshal.Cast<char, Utf16Char>(s.AsSpan()), style, NumberFormatInfo.GetInstance(provider), out result, out charsConsumed) == Number.ParsingStatus.OK;
System\Numerics\Complex.cs (3)
720return Parse(s.AsSpan(), style, provider);
821return Complex<double>.TryParsePartial(MemoryMarshal.Cast<char, Utf16Char>(s.AsSpan()), style, provider, out Unsafe.As<Complex, Complex<double>>(ref result), out charsConsumed);
841return TryParse(s.AsSpan(), style, provider, out result);
System\Numerics\Complex.Generic.cs (3)
1622return Parse(s.AsSpan(), style, provider);
1900=> TryParsePartial(MemoryMarshal.Cast<char, Utf16Char>(s.AsSpan()), style, provider, out result, out charsConsumed);
2047return TryParse(s.AsSpan(), style, provider, out result);
System.Security.Cryptography (69)
System.Security.Cryptography.Pkcs (5)
System.Security.Cryptography.Xml (1)
System.ServiceProcess.ServiceController (1)
System.Speech (1)
System.Text.Encodings.Web (7)
System.Text.Json (50)
System.Text.Json.SourceGeneration (2)
System.Text.RegularExpressions (24)
System.Text.RegularExpressions.Generator (25)
System.Web.HttpUtility (5)
System.Windows.Forms (14)
System.Windows.Forms.Design (1)
System.Windows.Forms.Primitives (12)
System.Xaml (1)
VBCSCompiler (8)