171 references to IndexOf
Aspire.Hosting.Garnet.Tests (1)
AddGarnetTests.cs (1)
315var saveIndex = args.IndexOf("--checkpointdir");
Aspire.Hosting.RabbitMQ (1)
RabbitMQBuilderExtensions.cs (1)
187var tagPrefix = existingTag[..existingTag.IndexOf($"-{alpine}")];
Aspire.Hosting.Redis.Tests (1)
AddRedisTests.cs (1)
661var saveIndex = args.IndexOf("--save");
Aspire.Hosting.Valkey.Tests (1)
AddValkeyTests.cs (1)
305var saveIndex = args.IndexOf("--save");
dotnet-svcutil-lib (2)
FrameworkFork\System.ServiceModel\System\IdentityModel\Claims\X509CertificateClaimSet.cs (1)
454int delimiterIndex = x509ExtensionFormattedString.IndexOf(subjectName1) - 1;
Shared\FrameworkInfo.cs (1)
69versionString = versionString.Substring(0, versionString.IndexOf("-"));
dotnet-svcutil-lib.Tests (2)
ProjectUtils.cs (2)
110int start = csStr.IndexOf("string optstring"); 111int end = csStr.IndexOf("string[] opts");
IdeCoreBenchmarks (1)
SyntacticChangeRangeBenchmark.cs (1)
39_index = text.IndexOf("switch (node.Kind)");
illink (1)
Microsoft.Arcade.Test.Common (1)
MockFileSystem.cs (1)
85if (targetPath.IndexOf(basePath) != 0)
Microsoft.Cci.Extensions (1)
Writers\CSharp\CSDeclarationWriter.Properties.cs (1)
155WriteIdentifier(name.Substring(name.IndexOf("_") + 1));
Microsoft.CodeAnalysis.CodeStyle (1)
src\Analyzers\Core\Analyzers\ValidateFormatString\AbstractValidateFormatStringDiagnosticAnalyzer.cs (1)
380var placeholderIndexText = textInsideBrackets.IndexOf(",") > 0
Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests (1)
CommandLineTests.cs (1)
1890var foundIndex = actual.IndexOf(version);
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (6)
CodeActions\InlineMethod\CSharpInlineMethodTests.cs (2)
94var firstMarkerIndex = expectedMarkUpForCallee.IndexOf(Marker); 128var firstMarkerIndex = expectedMarkUp.IndexOf(Marker);
CompleteStatement\CSharpCompleteStatementCommandHandlerTests.cs (1)
4172@"var test = ClassC.MethodM(" + argument.Remove(argument.IndexOf("$$"), 2) + ");$$");
Completion\CompletionProviders\LoadDirectiveCompletionProviderTests.cs (1)
81var position = textWithPositionMarker.IndexOf("$$");
Completion\CompletionProviders\ReferenceDirectiveCompletionProviderTests.cs (1)
120var position = textWithPositionMarker.IndexOf("$$");
Formatting\FormattingEngineTests.cs (1)
2084var position = text.IndexOf("/* __marker__ */");
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (1)
CodeGen\CodeGenTupleTest.cs (1)
22616var pos = source1.IndexOf("var(a, )") + 8;
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (4)
Semantics\ExtensionTests.cs (4)
5405comp2 = CreateCompilationWithIL(src2, expectedTypeIL.Remove(expectedTypeIL.IndexOf(remove), remove.Length) + ExtensionMarkerAttributeIL); 8466comp2 = CreateCompilationWithIL(src2, expectedTypeIL.Remove(expectedTypeIL.IndexOf(remove), remove.Length) + ExtensionMarkerAttributeIL); 10250comp3 = CreateCompilationWithIL(src3, expectedTypeIL.Remove(expectedTypeIL.IndexOf(remove), remove.Length) + ExtensionMarkerAttributeIL); 10553comp3 = CreateCompilationWithIL(src3, expectedTypeIL.Remove(expectedTypeIL.IndexOf(remove), remove.Length) + ExtensionMarkerAttributeIL);
Microsoft.CodeAnalysis.CSharp.Scripting.UnitTests (1)
CommandLineRunnerTests.cs (1)
775var foundIndex = actual.IndexOf(version);
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (3)
Semantics\NativeIntegerTests.cs (1)
4081int spanStart = source.IndexOf("nint i = 0;");
Semantics\NullableReferenceTypesTests.cs (1)
68272Diagnostic(ErrorCode.WRN_NullReferenceArgument, "s").WithArguments("s", "void M(CustomHandler c, string s)").WithLocation(5, 19 + expression.IndexOf("s.ToString"))
SourceGeneration\GeneratorDriverTests.cs (1)
1357var start = source.IndexOf(x.Location);
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (8)
Compilation\SemanticModelAPITests.cs (6)
4117var discarded2 = model.GetEnclosingSymbol(source.IndexOf(" => x")); 4360int spanStart = source.IndexOf("dynamic a = 5;"); 4402int positionInB = text.IndexOf("in B class level"); 4403int positionInBGoo = text.IndexOf("in B.Goo"); 4404int positionInCGoo = text.IndexOf("in C.Goo"); 4405int positionInN = text.IndexOf("in N");
SymbolDisplay\SymbolDisplayTests.cs (2)
5712SymbolDisplay.ToMinimalDisplayParts(symbol, model, text.IndexOf("offset 1"), format), 5715SymbolDisplay.ToMinimalDisplayParts(symbol, model, text.IndexOf("offset 2"), format),
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (28)
IncrementalParsing\IncrementalParsingTests.cs (28)
495var span = new TextSpan(source.IndexOf("]") + 1, length: 1); 527var span = new TextSpan(source.IndexOf("."), length: 1); 572var prefixSpan = new TextSpan(source.IndexOf(prefix), length: prefix.Length); 573var suffixSpan = new TextSpan(source.IndexOf(suffix), length: suffix.Length); 619var valueSetterLinePosition = initialSource.IndexOf(valueSetterLine); 3628var span = new TextSpan(source.IndexOf(" A[]?"), 0); 3649var span = new TextSpan(src.IndexOf(":"), 1); 3670var span = new TextSpan(source.IndexOf(";"), 0); 3691var span = new TextSpan(source.IndexOf(";") + 1, 0); 3712var span = new TextSpan(source.IndexOf(";") + 1, 0); 3734var span = new TextSpan(source.IndexOf(substring) + substring.Length, 0); 3758var span = new TextSpan(source.IndexOf(substring) + substring.Length, 0); 3782var span = new TextSpan(source.IndexOf(substring) + substring.Length, 0); 3806var span = new TextSpan(source.IndexOf(substring) + substring.Length, 0); 3830var span = new TextSpan(source.IndexOf(substring) + substring.Length, 0); 3854var span = new TextSpan(source.IndexOf(substring) + substring.Length, 1); 3880var span = new TextSpan(source.IndexOf(substring) + substring.Length, 0); 3905var span = new TextSpan(source.IndexOf(substring), 0); 3931var span = new TextSpan(source.IndexOf(substring) + substring.Length, 0); 3957var span = new TextSpan(source.IndexOf(substring) + substring.Length, 0); 3975var span = new TextSpan(source.IndexOf(substring) + substring.Length, 0); 3993var span = new TextSpan(source.IndexOf(substring) + substring.Length, 0); 4011var span = new TextSpan(source.IndexOf(substring) + substring.Length, 0); 4054var span = new TextSpan(start: source.IndexOf(substring), length: 3); // Goo[Goo] -> [Goo] 4091var span = new TextSpan(start: source.IndexOf(":") + 1, length: 0); 4114var position1 = source.IndexOf("i =") + 1; 4115var position2 = source.IndexOf("i <") + 1; 4116var position3 = source.IndexOf("i++") + 1;
Microsoft.CodeAnalysis.CSharp.Test.Utilities (1)
CSharpTestBase.cs (1)
3095var nameWithGenericsTrimmed = name.IndexOf("<") is not -1 and var index ? name[..index] : name;
Microsoft.CodeAnalysis.EditorFeatures (1)
CommentSelection\ToggleLineCommentCommandHandler.cs (1)
126var commentIndex = text.IndexOf(commentInfo.SingleLineCommentString) + line.Start;
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (2)
LinkedFiles\LinkedFileDiffMergingEditorTests.cs (2)
86.WithDocumentText(documentId, text.Replace(textString.IndexOf("public"), "public".Length, "internal")) 108.WithDocumentText(document.Id, (await document.GetTextAsync()).Replace(textString.IndexOf("public"), "public".Length, "internal"))
Microsoft.CodeAnalysis.Features (5)
EditAndContinue\Utilities\Extensions.cs (1)
197if (fieldName.StartsWith("<") && (closing = fieldName.IndexOf(">P")) > 1)
InitializeParameter\AbstractAddParameterCheckCodeRefactoringProvider.cs (1)
1009var index = text.IndexOf(Placeholder);
QuickInfo\QuickInfoUtilities.cs (1)
57var symbolIndex = FeaturesResources.Awaited_task_returns_0.IndexOf(defaultSymbol);
Shared\Utilities\ExtractTypeHelpers.cs (1)
75var index = rootNamespace.IsEmpty() ? -1 : containingNamespaceDisplay.IndexOf(rootNamespace);
src\Analyzers\Core\Analyzers\ValidateFormatString\AbstractValidateFormatStringDiagnosticAnalyzer.cs (1)
380var placeholderIndexText = textInsideBrackets.IndexOf(",") > 0
Microsoft.CodeAnalysis.Features.Test.Utilities (4)
EditAndContinue\ActiveStatementTestHelpers.cs (2)
55var start = src.IndexOf(startStr); 76var start = src.IndexOf(startStr);
EditAndContinue\EditAndContinueWorkspaceTestBase.cs (2)
473=> new TextSpan(str.IndexOf(substr), substr.Length); 574var index = markedSource.IndexOf(OpeningMarker);
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (1)
Workspaces\LspWorkspaceManagerTests.cs (1)
614(ProtocolConversions.TextSpanToRange(new TextSpan(initialContents.IndexOf("C3"), 1), originalSourceText), "D"));
Microsoft.CodeAnalysis.Test.Utilities (1)
Compilation\CompilationTestDataExtensions.cs (1)
33if (expectedIL.IndexOf(moduleNamePlaceholder) >= 0)
Microsoft.CodeAnalysis.UnitTests (2)
Diagnostics\AnalysisContextInfoTests.cs (1)
50Assert.True(diagnostics[0].ToString().IndexOf(analyzer.Info.GetContext()) >= 0);
Diagnostics\SuppressMessageAttributeCompilerTests.cs (1)
167exception.ToString().Substring(0, exception.ToString().IndexOf("---")) + "-----" + Environment.NewLine + Environment.NewLine +
Microsoft.CodeAnalysis.Workspaces.UnitTests (53)
SemanticModelReuse\SemanticModelReuseTests.cs (49)
54var model1 = await document.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None); 68var model1 = await document.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None); 69var model2 = await document.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None); 88var model1 = await document1.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None); 94var model2 = await document2.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None); 105var model1 = await document1.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None); 111var model2 = await document2.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None); 117var model3 = await document3.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None); 128var model1 = await document1.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None); 134var model2 = await document2.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None); 140var model3 = await document3.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None); 151var model1 = await document1.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None); 157var model2 = await document2.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None); 163var model3 = await document3.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None); 174var model1 = await document1.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None); 180var model2 = await document2.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None); 186var model3 = await document3.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None); 197var model1 = await document1.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None); 203var model2 = await document2.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None); 209var model3 = await document3.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None); 221var model1 = await document1.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None); 227var model2 = await document2.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None); 231CSharpSyntaxContext.CreateContext(document2, model2, source.IndexOf("void"), CancellationToken.None); 248var model1 = await document1.ReuseExistingSpeculativeModelAsync(source1.IndexOf("return"), CancellationToken.None); 254var model2 = await document2.ReuseExistingSpeculativeModelAsync(source2.IndexOf("{ return"), CancellationToken.None); 258CSharpSyntaxContext.CreateContext(document2, model2, source2.IndexOf("{ return"), CancellationToken.None); 289var model1 = await document.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None); 309var model1 = await document.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None); 310var model2 = await document.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None); 335var model1 = await document1.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None); 347var model2 = await document2.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None); 364var model1 = await document1.ReuseExistingSpeculativeModelAsync(source1.IndexOf("return"), CancellationToken.None); 377var model2 = await document2.ReuseExistingSpeculativeModelAsync(source2.IndexOf("return"), CancellationToken.None); 389var model3 = await document3.ReuseExistingSpeculativeModelAsync(source2.IndexOf("return"), CancellationToken.None); 406var model1 = await document1.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None); 418var model2 = await document2.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None); 430var model3 = await document3.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None); 449var model1 = await document1.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None); 463var model2 = await document2.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None); 477var model3 = await document3.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None); 496var model1 = await document1.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None); 510var model2 = await document2.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None); 524var model3 = await document3.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None); 542var model1 = await document1.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None); 554var model2 = await document2.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None); 558VisualBasicSyntaxContext.CreateContext(document2, model2, source.IndexOf("sub"), CancellationToken.None); 575var model1 = await document1.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None); 588var model2 = await document2.ReuseExistingSpeculativeModelAsync(source.IndexOf("return"), CancellationToken.None); 592VisualBasicSyntaxContext.CreateContext(document2, model2, source.IndexOf("return"), CancellationToken.None);
SolutionTests\ProjectSemanticVersionTests.cs (4)
114var span = new TextSpan(text.ToString().IndexOf("20"), length: 2); 142var span = new TextSpan(text.ToString().IndexOf("20"), length: 2); 226var span = new TextSpan(text.ToString().IndexOf("20"), length: 2); 254var span = new TextSpan(text.ToString().IndexOf("20"), length: 2);
Microsoft.DotNet.Build.Tasks.Feed (1)
src\PushToBuildStorage.cs (1)
548if (targetPath.IndexOf(basePath) != 0)
Microsoft.DotNet.Build.Tasks.Installers (3)
src\CreateWixBuildWixpack.cs (3)
546int startIdx = source.IndexOf("$("); 666int startIdx = path.IndexOf("$("); 708startIdx = path.IndexOf("$(");
Microsoft.DotNet.Build.Tasks.Packaging (1)
ValidateHarvestVersionIsLatestForRelease.cs (1)
108int startIndex = harvestedFrom.IndexOf(patternToSearchFor);
Microsoft.DotNet.Build.Tasks.Workloads (4)
WorkloadManifestPackage.wix.cs (2)
147!string.IsNullOrWhiteSpace(packageId) && packageId.IndexOf(ManifestSeparator) > -1 ? 148packageId.Substring(0, packageId.IndexOf(ManifestSeparator)) :
WorkloadPackageBase.cs (2)
305!string.IsNullOrWhiteSpace(packageId) && packageId.IndexOf(separator) > -1 ? 306packageId.Substring(packageId.IndexOf(separator) + separator.Length) :
Microsoft.DotNet.CodeAnalysis (1)
Analyzers\AppContextDefaultsAnalyzer.cs (1)
111if (call.Expression.ToString().IndexOf("DefineSwitchDefault") == -1)
Microsoft.DotNet.SignCheckLibrary (3)
Verification\Jar\JarIndividualSection.cs (1)
42int entryStartIndex = RawText.IndexOf("Name:");
Verification\Jar\JarManifestFileBase.cs (2)
112int crNameIndex = ManifestText.IndexOf("\rName:"); 113int lfNameIndex = ManifestText.IndexOf("\nName:");
Microsoft.DotNet.SignTool (1)
src\ZipData.cs (1)
623int index = fileContents.IndexOf(stringToFind);
Microsoft.DotNet.XliffTasks (2)
Model\UnstructuredDocument.cs (2)
27int spanStart = text.IndexOf(TranslatableSpanMarker); 44int separatorIndex = translatableSpan.IndexOf(TranslatableSpanSeparator);
Microsoft.Extensions.AI.Integration.Tests (2)
VerbatimMultiPartHttpHandler.cs (2)
99int headerEnd = part.IndexOf("\r\n\r\n"); 177int start = headers.IndexOf(NamePrefix) + NamePrefix.Length;
Microsoft.Extensions.ServiceDiscovery (1)
Configuration\ConfigurationServiceEndpointProvider.cs (1)
204if (value.IndexOf("://") < 0 && Uri.TryCreate($"fakescheme://{value}", default, out var uri))
Microsoft.Interop.JavaScript.JSImportGenerator (4)
JSMarshalAsAttributeInfoParser.cs (4)
30string name = gt.Substring(gt.IndexOf("JSType") + "JSType.".Length); 31name = name.Substring(0, name.IndexOf("<")); 37string argName = ta.Substring(ta.IndexOf("JSType") + "JSType.".Length); 46string name = st.Substring(st.IndexOf("JSType") + "JSType.".Length);
Microsoft.Maui.Controls.Build.Tasks (1)
PerformanceProvider.cs (1)
74 int index = path.IndexOf("Microsoft.Maui.Controls.");
Microsoft.ML.Data (3)
Utilities\StreamUtils.cs (3)
63if (pattern == null || (pattern.IndexOfAny(_wildPlusChars) < 0 && pattern.IndexOf("...") < 0)) 78if (currentPattern.IndexOfAny(_wildChars) >= 0 || currentPattern.IndexOf("...") >= 0) 81int recursiveIndex = currentPattern.IndexOf("...");
Microsoft.VisualBasic.Core (1)
Microsoft\VisualBasic\CompilerServices\Utils.LateBinder.vb (1)
137iIndex = s.IndexOf(nfi.NumberDecimalSeparator)
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (1)
ProjectSystemShim\CSharpHelpers.cs (1)
120var index = arg.IndexOf(outPrefix);
Roslyn.Test.Performance.Utilities (1)
VsPerfTest.cs (1)
106public override string Name => _testTemplateName.Substring(0, _testTemplateName.IndexOf("Template.xml"));
Roslyn.VisualStudio.Next.UnitTests (4)
Services\ServiceHubServicesTests.cs (1)
1860var listIndex = text.ToString().IndexOf("X");
UnifiedSettings\TestModel\Utilities.cs (3)
26var resourcesIdentifier = resourceReference.Substring(1, resourceReference.IndexOf(";") - 1); 27var resources = resourceReference[(resourceReference.IndexOf(";") + 1)..]; 45var resourceDll = resourceReference[(resourceReference.IndexOf("\\") + 1)..];
System.Net.NetworkInformation (1)
System\Net\NetworkInformation\StringParsingHelpers.Addresses.cs (1)
133int labelIndex = fileContents.IndexOf(label);
System.ServiceModel.Primitives (1)
System\IdentityModel\Claims\X509CertificateClaimSet.cs (1)
479int delimiterIndex = x509ExtensionFormattedString.IndexOf(subjectName1) - 1;