2298 references to Substring
aspire (43)
Agents\AspireSkills\AspireSkillsBundleProvider.cs (2)
391var value = line[keyPrefix.Length..].Trim(); 706var operand = comparator[op.Length..];
Agents\DeprecatedMcpCommandScanner.cs (1)
64File.AppendAllText(debugPath, $"[{DateTime.UtcNow:O}] -> Content: {content.Substring(0, Math.Min(200, content.Length))}\n");
Certificates\CertificateGeneration\UnixCertificateManager.cs (1)
385? Path.Combine("$HOME", certDir[homeDirectoryWithSlash.Length..])
Commands\PipelineCommandBase.cs (1)
527value = token["--format=".Length..];
Commands\Sdk\SdkExportCommand.cs (1)
342var suffix = suffixIndex >= 0 ? version[suffixIndex..] : string.Empty;
Diagnostics\CliLogFormat.cs (2)
129line[levelStart..levelEnd], 130line[categoryStart..categoryEnd],
Documentation\Docs\DocsIndexService.cs (2)
968builder.Append(NormalizeMarkdownSegment(content[position..match.Index])); 973builder.Append(NormalizeMarkdownSegment(content[position..]));
Git\GitWorktree.cs (2)
282var gitDir = line[GitDirPrefix.Length..].Trim(); 366var segments = resolvedPath[root.Length..].Split(
Mcp\Tools\ListIntegrationsTool.cs (2)
177return packageId["CommunityToolkit.Aspire.Hosting.".Length..]; 183return packageId["Aspire.Hosting.".Length..];
Npm\INpmProvenanceChecker.cs (1)
163var afterRefs = refString["refs/".Length..];
Npm\SigstoreNpmProvenanceChecker.cs (2)
304var hashBase64 = sriIntegrity["sha512-".Length..]; 360var digestBytes = Convert.FromBase64String(sriIntegrity["sha512-".Length..]);
Projects\DotNetAppHostProject.cs (4)
478? trimmed[thisFileDirectory.Length..].TrimStart('/', '\\') 620foreach (var rawSegment in start[thisFileDirectory.Length..].Split('/', '\\')) 959foreach (var rawSegment in start[thisFileDirectory.Length..].Split('/', '\\')) 1120? projectAttributeValue[suffixStart..].Trim()
Projects\ProjectUpdater.cs (1)
1174return expression.Substring(2, expression.Length - 3);
Projects\TypeScriptAppHostToolchainResolver.cs (1)
364var version = packageManager[yarnPackageManagerPrefix.Length..];
Scaffolding\PackageJsonMerger.cs (1)
194var unprefixed = name[AspirePrefix.Length..];
src\Shared\BackchannelConstants.cs (3)
369var afterPrefix = fileName[$"{SocketPrefix}.".Length..]; 377var afterPrefix = fileName["aux.sock.".Length..]; 650var instanceId = fileName[CompactAppHostIdLength..pidSeparatorIndex];
src\Shared\ConsoleLogs\AnsiParser.cs (6)
43outputBuilder.Append(text[lastWritePos..]); 57outputBuilder.Append(text[lastWritePos..nextEscapeIndex]); 102outputBuilder.Append(text[textStartIndex..(textStartIndex + textLength)]); 122outputBuilder.Append(text[textStartIndex..(textStartIndex + textLength)]); 145outputBuilder.Append(text[textStartIndex..(textStartIndex + textLength)]); 194outputBuilder.Append(text[textStartIndex..(textStartIndex + textLength)]);
src\Shared\ConsoleLogs\UrlParser.cs (1)
36var url = text[urlStart..nextCharIndex];
src\Shared\PathNormalizer.cs (2)
154var relative = fullPath[root.Length..]; 242var relative = fullPath[root.Length..];
Telemetry\InternalMicrosoftDetector.cs (1)
1190? JsonNode.Parse(text[start..(end + 1)], documentOptions: new JsonDocumentOptions { AllowTrailingCommas = true }) as JsonObject
Templating\CliTemplateFactory.cs (1)
324var relativePath = resourceName[resourcePrefix.Length..].Replace('/', Path.DirectorySeparatorChar);
Templating\ConditionalBlockProcessor.cs (1)
93var blockContent = content[startLineEnd..endLineBegin];
Utils\CliPathHelper.cs (1)
269return path[PrivateSegmentLength..];
Utils\DotNetToolDetection.cs (1)
259var packageRuntimeIdentifier = packageId[ridSpecificPackagePrefix.Length..];
Utils\EnvironmentChecker\DcpKubeconfig.cs (1)
115var value = trimmed[prefix.Length..].Trim();
Utils\ReparsePoint.cs (1)
323return target[ntLocalPathPrefix.Length..];
Aspire.Azure.Messaging.ServiceBus (1)
AzureMessagingServiceBusSettings.cs (1)
146QueueOrTopicName = entityPath.Substring(0, subscriptionsIndex);
Aspire.Cli.EndToEnd.Tests (8)
Helpers\CaptureWorkspaceOnFailureAttribute.cs (4)
68var label = kvp.Key["CapturePath:".Length..]; 76var fileName = kvp.Key["CaptureFile:".Length..]; 100var label = kvp.Key["CapturePath:".Length..]; 109var fileName = kvp.Key["CaptureFile:".Length..];
Helpers\CliE2EAutomatorHelpers.cs (1)
186return formattedMessage[suffixStart..];
Helpers\CliE2ETestHelpers.cs (1)
583return $"hex1b-test-{Guid.NewGuid():N}".Substring(0, 32);
tests\Shared\CliPackageDiscovery.cs (2)
67var version = fileName[AspireCliPackagePrefix.Length..^NupkgSuffix.Length]; 74var version = fileName[AspireCliPackagePrefix.Length..^NupkgSuffix.Length];
Aspire.Cli.Tests (11)
Agents\CommonAgentApplicatorsTests.cs (1)
197var value = line[keyPrefix.Length..].Trim();
DotNet\DotNetCliRunnerTests.cs (1)
526var binlogPath = binlogArgument["/bl:".Length..];
DotNet\ProcessExecutionTests.cs (1)
151using var jsonDocument = JsonDocument.Parse(stdout[jsonStart..]);
Mcp\ListResourcesToolTests.cs (1)
172var jsonPortion = textContent.Text.Substring(jsonStartIndex, jsonEndIndex - jsonStartIndex);
Mcp\ListStructuredLogsToolTests.cs (1)
190var jsonText = textContent.Text[jsonStartIndex..jsonEndIndex];
Mcp\ListTracesToolTests.cs (1)
162var jsonText = textContent.Text[jsonStartIndex..jsonEndIndex];
Npm\AspireJsLauncherTests.cs (4)
200return new RidProbeCase("win32", rid["win-".Length..], false); 205return new RidProbeCase("darwin", rid["osx-".Length..], false); 210return new RidProbeCase("linux", rid["linux-musl-".Length..], true); 215return new RidProbeCase("linux", rid["linux-".Length..], false);
tests\Shared\Logging\XunitLoggerProvider.cs (1)
98message = message.Substring(0, message.Length - Environment.NewLine.Length);
Aspire.Dashboard (12)
Model\ConnectionStringParser.cs (1)
191? connectionString[jdbcPrefix.Length..]
Model\Markdown\MarkdownHelpers.cs (1)
184var code = literal.Content.Text.Substring(indexOfBacktick + 1, originalLength - literal.Content.Length - 1);
Otlp\Storage\ResourceKey.cs (1)
37return new ResourceKey(Name: instanceId.Substring(0, separator), InstanceId: instanceId.Substring(separator + 1));
src\Shared\ConsoleLogs\AnsiParser.cs (6)
43outputBuilder.Append(text[lastWritePos..]); 57outputBuilder.Append(text[lastWritePos..nextEscapeIndex]); 102outputBuilder.Append(text[textStartIndex..(textStartIndex + textLength)]); 122outputBuilder.Append(text[textStartIndex..(textStartIndex + textLength)]); 145outputBuilder.Append(text[textStartIndex..(textStartIndex + textLength)]); 194outputBuilder.Append(text[textStartIndex..(textStartIndex + textLength)]);
src\Shared\ConsoleLogs\UrlParser.cs (1)
36var url = text[urlStart..nextCharIndex];
Terminal\TerminalWebSocketProxy.cs (1)
60var connectionId = Guid.NewGuid().ToString("n").Substring(0, 8);
Utils\DashboardUIHelpers.cs (1)
157var baseUrl = url.Substring(0, questionMarkIndex);
Aspire.Dashboard.Components.Tests (2)
Controls\LogViewerTests.cs (1)
460return declaration[propertyPrefix.Length..].Trim();
tests\Shared\Logging\XunitLoggerProvider.cs (1)
98message = message.Substring(0, message.Length - Environment.NewLine.Length);
Aspire.Dashboard.Tests (4)
Model\GenAIVisualizerDialogViewModelTests.cs (3)
2160var truncatedInput = inputMessages.Substring(0, inputMessages.IndexOf("Third")); 2232var truncatedInstruction = systemInstruction.Substring(0, systemInstruction.IndexOf("Second")); 2301var truncatedOutput = outputMessages.Substring(0, outputMessages.IndexOf("Truncated"));
tests\Shared\Logging\XunitLoggerProvider.cs (1)
98message = message.Substring(0, message.Length - Environment.NewLine.Length);
Aspire.Deployment.EndToEnd.Tests (3)
AzureResourceScopeDeploymentTests.cs (1)
186var version = line[sdkDirectivePrefix.Length..].Trim();
tests\Shared\CliPackageDiscovery.cs (2)
67var version = fileName[AspireCliPackagePrefix.Length..^NupkgSuffix.Length]; 74var version = fileName[AspireCliPackagePrefix.Length..^NupkgSuffix.Length];
Aspire.Hosting (16)
ContainerResourceBuilderExtensions.cs (1)
454var digest = parsedReference.Digest[prefix.Length..];
Dashboard\DashboardEventHandlers.cs (2)
316? fileName.Substring(0, fileName.Length - 4) 1006var categoryTrimmed = category["Aspire.Dashboard.".Length..];
Dcp\ContainerCreator.cs (1)
127var shortApplicationName = _normalizedApplicationName.Length < 32 ? _normalizedApplicationName : _normalizedApplicationName.Substring(0, 32);
Dcp\DcpNameGenerator.cs (1)
153var suffix = _configuration["AppHost:Sha256"]!.Substring(0, RandomNameSuffixLength).ToLowerInvariant();
src\Shared\BackchannelConstants.cs (3)
369var afterPrefix = fileName[$"{SocketPrefix}.".Length..]; 377var afterPrefix = fileName["aux.sock.".Length..]; 650var instanceId = fileName[CompactAppHostIdLength..pidSeparatorIndex];
src\Shared\ConsoleLogs\AnsiParser.cs (6)
43outputBuilder.Append(text[lastWritePos..]); 57outputBuilder.Append(text[lastWritePos..nextEscapeIndex]); 102outputBuilder.Append(text[textStartIndex..(textStartIndex + textLength)]); 122outputBuilder.Append(text[textStartIndex..(textStartIndex + textLength)]); 145outputBuilder.Append(text[textStartIndex..(textStartIndex + textLength)]); 194outputBuilder.Append(text[textStartIndex..(textStartIndex + textLength)]);
src\Shared\PathNormalizer.cs (2)
154var relative = fullPath[root.Length..]; 242var relative = fullPath[root.Length..];
Aspire.Hosting.Analyzers (2)
Infrastructure\WellKnownTypes.cs (2)
39name = name.Substring(0, separator); 40typeIdName = typeIdName.Substring(0, separator);
Aspire.Hosting.Analyzers.Tests (1)
AnalyzerTest.cs (1)
51.GetCustomAttribute<TargetFrameworkAttribute>()!.FrameworkName[".NETCoreApp,Version=v".Length..];
Aspire.Hosting.Azure (2)
AzureEnvironmentResource.cs (1)
306? type["Microsoft.".Length..]
AzureProvisioningFailureDetails.cs (1)
776? message[valueStart..valueEnd]
Aspire.Hosting.Azure.AppContainers (1)
AzureContainerAppExtensions.cs (1)
237var value = normalizedExpression[TakePrefix.Length..separatorIndex];
Aspire.Hosting.Azure.AppService (1)
AzureAppServiceWebSiteResource.cs (1)
137return value.Substring(0, maxLength);
Aspire.Hosting.Azure.Sql (1)
AzureSqlServerResource.cs (1)
622var storageName = $"{sqlName.Substring(0, Math.Min(sqlName.Length, 10))}-store";
Aspire.Hosting.Azure.Tests (2)
AzureDeployerTests.cs (2)
726return end >= 0 ? diagnostics[start..end] : diagnostics[start..];
Aspire.Hosting.CodeGeneration.Java (6)
AtsJavaCodeGenerator.cs (6)
235_ when declarationLine.StartsWith("public ", StringComparison.Ordinal) => declarationLine["public ".Length..].TrimStart(), 236_ when declarationLine.StartsWith("final ", StringComparison.Ordinal) => declarationLine["final ".Length..].TrimStart(), 237_ when declarationLine.StartsWith("abstract ", StringComparison.Ordinal) => declarationLine["abstract ".Length..].TrimStart(), 238_ when declarationLine.StartsWith("static ", StringComparison.Ordinal) => declarationLine["static ".Length..].TrimStart(), 258declarationName = declarationLine[kindPrefix.Length..] 469var imported = importLine["import ".Length..].TrimEnd(';').Trim();
Aspire.Hosting.CodeGeneration.Rust.Tests (1)
RustLanguageSupportTests.cs (1)
138names.Add(trimmed[namePrefix.Length..].TrimEnd('"'));
Aspire.Hosting.CodeGeneration.TypeScript (2)
AtsTypeScriptCodeGenerator.cs (1)
280var markerBody = text[markerBodyStartIndex..markerEndIndex];
TypeScriptApiProjector.cs (1)
893var markerBody = text[markerBodyStartIndex..markerEndIndex];
Aspire.Hosting.CodeGeneration.TypeScript.Tests (1)
AtsTypeScriptCodeGeneratorTests.cs (1)
2223var interfaceBody = code[interfaceStart..(interfaceEnd + 1)];
Aspire.Hosting.DevTunnels (2)
DevTunnelCliClient.cs (1)
47? versionLine[prefix.Length..].Trim()
DevTunnelResourceBuilderExtensions.cs (1)
899var hostSuffix = portUri.Host[hostPrefixLength..];
Aspire.Hosting.Dotnet (2)
src\Shared\PathNormalizer.cs (2)
154var relative = fullPath[root.Length..]; 242var relative = fullPath[root.Length..];
Aspire.Hosting.EntityFrameworkCore (1)
EFCoreOperationExecutor.cs (1)
456var remainder = content[PrefixLength..];
Aspire.Hosting.Foundry (1)
FoundryLocalService.cs (1)
322var candidate = line[modelIdStart..].Trim();
Aspire.Hosting.Integration.Analyzers (3)
AspireExportAnalyzer.cs (1)
842shortName = shortName.Substring(0, shortName.Length - "Resource".Length);
src\Aspire.Hosting.Analyzers\Infrastructure\WellKnownTypes.cs (2)
39name = name.Substring(0, separator); 40typeIdName = typeIdName.Substring(0, separator);
Aspire.Hosting.Java (2)
src\Shared\PathNormalizer.cs (2)
154var relative = fullPath[root.Length..]; 242var relative = fullPath[root.Length..];
Aspire.Hosting.Java.Tests (3)
AddJavaAppPublishTests.cs (2)
45var selection = content[selectionIndex..content.IndexOf('\n', selectionIndex)]; 1428var stagingCommand = content[start..(end < 0 ? content.Length : end)];
AddJavaAppTests.cs (1)
1428writer.Write($"Main-Class: {mainClass[..split]}\r\n {mainClass[split..]}\r\n");
Aspire.Hosting.JavaScript (2)
src\Shared\PathNormalizer.cs (2)
154var relative = fullPath[root.Length..]; 242var relative = fullPath[root.Length..];
Aspire.Hosting.Kubernetes (1)
Deployment\HelmDeploymentEngine.cs (1)
400path = path[".Values.".Length..];
Aspire.Hosting.Maui (2)
src\Shared\PathNormalizer.cs (2)
154var relative = fullPath[root.Length..]; 242var relative = fullPath[root.Length..];
Aspire.Hosting.Radius (1)
Publishing\RadiusInfrastructureBuilder.cs (1)
1279var indexText = format.Substring(i + 1, close - i - 1);
Aspire.Hosting.Radius.Tests (1)
Publishing\ConfigureRadiusInfrastructureTests.cs (1)
274var appBlock = bicep.Substring(appIdx, appBlockEnd - appIdx);
Aspire.Hosting.RemoteHost (4)
Ats\ReferenceExpressionRef.cs (4)
291parts.Add(format[current..]); 299parts.Add(format[current..start]); 307parts.Add(format[start..]); 312parts.Add(format[start..(end + 1)]);
Aspire.Hosting.Rust (2)
src\Shared\PathNormalizer.cs (2)
154var relative = fullPath[root.Length..]; 242var relative = fullPath[root.Length..];
Aspire.Hosting.Sdk.Tests (2)
AppHostSdkTargetsTests.cs (2)
1211using var document = JsonDocument.Parse(result.StandardOutput[jsonStart..(jsonEnd + 1)]); 1674return packageReference[prefix.Length..equalsIndex];
Aspire.Hosting.Tasks (3)
ResolveAspireCliBundle.cs (2)
380: directoryName.Substring(0, versionEnd).TrimEnd('.'); 396return directoryName.Substring(0, separatorIndex);
ResolveAspireCliInvocation.cs (1)
202sdkVersion = separatorIndex > 0 ? lastLine!.Substring(0, separatorIndex) : null;
Aspire.Hosting.Testing (2)
DistributedApplicationFactory.cs (2)
308SetDefault(key["DOTNET_".Length..], value); 314SetDefault(key["ASPNETCORE_".Length..], value);
Aspire.Hosting.Testing.Tests (2)
DashboardUrlTests.cs (1)
332var token = dashboardUri.Query["?t=".Length..];
tests\Shared\Logging\XunitLoggerProvider.cs (1)
98message = message.Substring(0, message.Length - Environment.NewLine.Length);
Aspire.Hosting.Tests (1)
Dcp\DcpHostNotificationTests.cs (1)
748return arguments[start..end];
Aspire.Hosting.TestUtilities (1)
tests\Shared\Logging\XunitLoggerProvider.cs (1)
98message = message.Substring(0, message.Length - Environment.NewLine.Length);
Aspire.Playground.Tests (1)
tests\Shared\Logging\XunitLoggerProvider.cs (1)
98message = message.Substring(0, message.Length - Environment.NewLine.Length);
Aspire.StackExchange.Redis (1)
src\Vendoring\OpenTelemetry.Instrumentation.StackExchangeRedis\Shared\AssemblyVersionExtensions.cs (1)
30? informationalVersion.Substring(0, indexOfPlusSign)
Binding.WS.TransportWithMessageCredentialSecurity.IntegrationTests (6)
BasicHttpTransportWithMessageCredentialSecurityTests.cs (3)
83username = Guid.NewGuid().ToString("n").Substring(0, 8); 132username = Guid.NewGuid().ToString("n").Substring(0, 8); 184username = Guid.NewGuid().ToString("n").Substring(0, 8);
WS2007HttpTransportWithMessageCredentialsSecurityTests.cs (1)
84username = Guid.NewGuid().ToString("n").Substring(0, 8);
WSHttpTransportWithMessageCredentialSecurityTests.cs (1)
85username = Guid.NewGuid().ToString("n").Substring(0, 8);
WSNetTcpTransportWithMessageCredentialSecurityTests.cs (1)
88username = Guid.NewGuid().ToString("n").Substring(0, 8);
Crossgen2Tasks (2)
CommonFilePulledFromSdkRepo\Logger.cs (1)
93code = format.Substring(0, 10);
ResolveReadyToRunCompilers.cs (1)
287platform = runtimeIdentifier.Substring(0, separator).ToLowerInvariant();
CSharpSyntaxGenerator (2)
AbstractFileWriter.cs (2)
210var sub = typeName.Substring(iStart + 1, iEnd - iStart - 1); 287? name.Substring(0, name.Length - post.Length)
dotnet (17)
CommandFactory\CommandResolution\PackagedCommandSpecFactoryWithCliRuntime.cs (1)
59version = version.Substring(0, dashOrPlusIndex);
Commands\New\MSBuildEvaluation\CapabilityExpressionEvaluator.cs (1)
232return Input.Substring(begin, end - begin);
Commands\Test\MTP\MicrosoftTestingPlatformTestCommand.cs (1)
560string CurrentToken() => line.Substring(tokenStart, position - tokenStart).Replace("\"", string.Empty);
Commands\Test\MTP\Terminal\TargetFrameworkParser.cs (1)
69: $"net{frameworkDescription.Substring(net.Length + 1, firstDotInVersion - net.Length - 1)}.{frameworkDescription[firstDotInVersion + 1]}";
Commands\Test\MTP\TestResultsDirectoryResolver.cs (2)
204string[] firstSegments = first[firstRoot.Length..].Split(separators, StringSplitOptions.RemoveEmptyEntries); 205string[] secondSegments = second[secondRoot.Length..].Split(separators, StringSplitOptions.RemoveEmptyEntries);
Commands\Workload\WorkloadUtilities.cs (2)
23var firstVersion = new Version(first.Substring(0, firstDash)); 24var secondVersion = new Version(second.Substring(0, secondDash));
InteractiveConsole.cs (1)
64valueKey.ToLowerInvariant().Substring(0, 1));
LoggerUtility.cs (1)
32filename = filename.Substring(0, filename.Length - ".binlog".Length);
ShellShim\WindowsEnvironmentPath.cs (1)
56existingUserEnvPath = existingUserEnvPath.Substring(0, existingUserEnvPath.Length - 1);
src\sdk\src\Resolvers\Microsoft.DotNet.MSBuildSdkResolver\FXVersion.cs (6)
20return next == -1 ? ids.Substring(idStart) : ids.Substring(idStart, next - idStart); 179if (!ValidIdentifier(ids.Substring(idStart, nextId - idStart), buildMeta)) 221if (!int.TryParse(fxVersionString.Substring(0, majorSeparator), out major)) 240if (!int.TryParse(fxVersionString.Substring(minorStart, minorSeparator - minorStart), out minor)) 272if (!int.TryParse(fxVersionString.Substring(patchStart, patchSeparator - patchStart), out patch)) 284string pre = (preSeparator == -1) ? fxVersionString.Substring(preStart) : fxVersionString.Substring(preStart, preSeparator - preStart);
dotnet-aot (4)
src\sdk\src\Cli\dotnet\Commands\Workload\WorkloadUtilities.cs (2)
23var firstVersion = new Version(first.Substring(0, firstDash)); 24var secondVersion = new Version(second.Substring(0, secondDash));
src\sdk\src\Cli\dotnet\LoggerUtility.cs (1)
32filename = filename.Substring(0, filename.Length - ".binlog".Length);
src\sdk\src\Cli\dotnet\ShellShim\WindowsEnvironmentPath.cs (1)
56existingUserEnvPath = existingUserEnvPath.Substring(0, existingUserEnvPath.Length - 1);
dotnet-dev-certs (3)
src\aspnetcore\src\Shared\CertificateGeneration\UnixCertificateManager.cs (1)
361? Path.Combine("$HOME", certDir[homeDirectoryWithSlash.Length..])
src\aspnetcore\src\Shared\CommandLineUtils\CommandLine\AnsiConsole.cs (1)
84var text = message.Substring(escapeScan, escapeIndex - escapeScan);
src\aspnetcore\src\Shared\CommandLineUtils\CommandLine\CommandOption.cs (1)
40ValueName = part.Substring(1, part.Length - 2);
dotnet-getdocument (2)
src\aspnetcore\src\Shared\CommandLineUtils\CommandLine\AnsiConsole.cs (1)
84var text = message.Substring(escapeScan, escapeIndex - escapeScan);
src\aspnetcore\src\Shared\CommandLineUtils\CommandLine\CommandOption.cs (1)
40ValueName = part.Substring(1, part.Length - 2);
dotnet-Microsoft.XmlSerializer.Generator (1)
Sgen.cs (1)
687parsedArgs.Add(line.Substring(0, i));
dotnet-openapi (2)
src\aspnetcore\src\Shared\CommandLineUtils\CommandLine\AnsiConsole.cs (1)
84var text = message.Substring(escapeScan, escapeIndex - escapeScan);
src\aspnetcore\src\Shared\CommandLineUtils\CommandLine\CommandOption.cs (1)
40ValueName = part.Substring(1, part.Length - 2);
dotnet-razorpagegenerator (1)
Program.cs (1)
212var includeFileName = cshtmlContent.Substring(startIndex + startMatch.Length, endIndex - (startIndex + startMatch.Length));
dotnet-sourcelink (2)
dotnet-sql-cache (2)
src\aspnetcore\src\Shared\CommandLineUtils\CommandLine\AnsiConsole.cs (1)
84var text = message.Substring(escapeScan, escapeIndex - escapeScan);
src\aspnetcore\src\Shared\CommandLineUtils\CommandLine\CommandOption.cs (1)
40ValueName = part.Substring(1, part.Length - 2);
dotnet-svcutil-lib (97)
FrameworkFork\Microsoft.CodeDom\Microsoft\CSharpCodeProvider.cs (2)
3752sb.Append(CreateEscapedIdentifier(baseType.Substring(lastIndex, i - lastIndex))); 3759sb.Append(CreateEscapedIdentifier(baseType.Substring(lastIndex, i - lastIndex)));
FrameworkFork\Microsoft.CodeDom\Microsoft\VBCodeProvider.cs (4)
1237Output.Write(typeName.Substring(0, index + 1)); 2957value = value.Substring(1, value.Length - 2); 3073sb.Append(CreateEscapedIdentifier(baseType.Substring(lastIndex, i - lastIndex))); 3080sb.Append(CreateEscapedIdentifier(baseType.Substring(lastIndex, i - lastIndex)));
FrameworkFork\Microsoft.CodeDom\System\CodeTypeReference.cs (5)
218subTypeNames.Push(typeName.Substring(current + 1, subTypeNameEndIndex - current - 1)); 231subTypeNames.Push(typeName.Substring(current + 1, subTypeNameEndIndex - current - 1)); 252CodeTypeReference type = new CodeTypeReference(typeName.Substring(0, end + 1), Options); 277_baseType = typeName.Substring(0, end + 1); 462result = typeName.Substring(start, index - start);
FrameworkFork\Microsoft.Xml\Xml\Core\XmlCharCheckingWriter.cs (1)
188writer.WriteCData(text.Substring(0, i + 2));
FrameworkFork\Microsoft.Xml\Xml\Core\XmlTextReaderImpl.cs (2)
9777return value.Substring(startPos, i - startPos); 9799return (startPos == 0) ? value : value.Substring(startPos, len - startPos);
FrameworkFork\Microsoft.Xml\Xml\Dom\XmlCharacterData.cs (1)
92return _data.Substring(offset, count);
FrameworkFork\Microsoft.Xml\Xml\Dom\XmlEntityReference.cs (1)
192buf = baseURI.Substring(0, nCount);
FrameworkFork\Microsoft.Xml\Xml\Dom\XmlNode.cs (1)
1275prefix = name.Substring(0, colonPos);
FrameworkFork\Microsoft.Xml\Xml\schema\DtdParser.cs (3)
295_schemaInfo.DocTypeName = new XmlQualifiedName(_nameTable.Add(docTypeName.Substring(0, colonPos)), 3656return value.Substring(startPos, i - startPos); 3678return (startPos == 0) ? value : value.Substring(startPos, len - startPos);
FrameworkFork\Microsoft.Xml\Xml\schema\XmlAtomicValue.cs (1)
405return value.Substring(0, colonOffset);
FrameworkFork\Microsoft.Xml\Xml\schema\XmlSchemaDatatype.cs (2)
358canonicalUri = nameTable.Add(uri.Substring(0, offset) + uri.Substring(offset, uri.Length - offset).ToUpperInvariant());
FrameworkFork\Microsoft.Xml\Xml\Serialization\CodeIdentifier.cs (3)
189EscapeKeywords(name.Substring(0, nameEnd), csharp, sb); 256identifier = identifier.Substring(0, identifier.Length - 2); 281sb.Append(originalIdentifier.Substring(separator, 1));
FrameworkFork\Microsoft.Xml\Xml\Serialization\Mappings.cs (1)
116return new XmlQualifiedName(XmlConvert.EncodeLocalName(name.Substring(colon + 1)), XmlConvert.EncodeLocalName(name.Substring(0, colon))).ToString();
FrameworkFork\Microsoft.Xml\Xml\Serialization\Types.cs (3)
1035name = name.Substring(0, arity); 1408ns = type.Substring(0, nsLen); 1416name = type.Substring(nsLen + 1, nameLen - nsLen - 1);
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlReflectionImporter.cs (3)
1989if (xmlName.Substring(0, xmlName.Length - 1) == anyNs) 1998string choiceNs = colon < 0 ? choiceMapping.Namespace : xmlName.Substring(0, colon); 2122string choiceNs = colon < 0 ? "" : choiceId.Substring(0, colon);
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlSerializationReader.cs (3)
819attr.Value = _r.LookupNamespace(attr.Value.Substring(0, colon)) + ":" + attr.Value.Substring(colon + 1); 1202string prefix = colon < 0 ? null : value.Substring(0, colon); 2006xsiTypeNs = Reader.LookupNamespace((colon >= 0) ? value.Substring(0, colon) : "");
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlSerializationWriter.cs (4)
982string prefix = localName.Substring(0, colon); 1015string prefix = localName.Substring(0, colon); 3680string choiceNs = colon < 0 ? choiceMapping.Namespace : xmlName.Substring(0, colon); 3982string assemblyName = (iComma > -1) ? assemblyFullName.Substring(0, iComma) : assemblyFullName;
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlSerializationWriterILGen.cs (1)
2394string choiceNs = colon < 0 ? choiceMapping.Namespace : xmlName.Substring(0, colon);
FrameworkFork\Microsoft.Xml\Xml\ValidateNames.cs (5)
313prefix = s.Substring(0, colonOffset); 346localName = s.Substring(0, len); 364localName = s.Substring(offset, lenLocal); 652prefix = name.Substring(0, colonPos); 654lname = name.Substring(colonPos, name.Length - colonPos);
FrameworkFork\Microsoft.Xml\Xml\XmlComplianceUtil.cs (2)
57return value.Substring(startPos, i - startPos); 94return value.Substring(startPos, len - startPos);
FrameworkFork\Microsoft.Xml\Xml\XPath\Internal\StringFunctions.cs (2)
153return (idx < 1) ? string.Empty : s1.Substring(0, idx); 196return str1.Substring((int)num, (int)num1);
FrameworkFork\Microsoft.Xml\Xml\XPath\Internal\XPathScanner.cs (4)
303return XmlConvert.ToXPathDouble(_xpathExpr.Substring(start, len)); 316return XmlConvert.ToXPathDouble(_xpathExpr.Substring(start, len)); 335return _xpathExpr.Substring(start, len); 367return _xpathExpr.Substring(start, len);
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\CodeExporter.cs (2)
470string containingTypeName = originalName.Substring(0, nestedTypeIndex); 1355identifier = identifier.Substring(0, MaxIdentifierLength - requiredLength);
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\DataContract.cs (7)
1687typeName = typeName.Substring(0, iParam); 1749string tempLocalName = typeName.Substring(startIndex, endIndex - startIndex); 1761nestedParamCounts.Add(Int32.Parse(typeName.Substring(endIndex + 1, startIndex - endIndex - 1), CultureInfo.InvariantCulture)); 1826ns = fullTypeName.Substring(0, nsEnd); 1831localName = localName.Substring(0, iParam); 2040if (!Int32.TryParse(format.Substring(start, i - start), out paramIndex) || paramIndex < 0 || paramIndex >= genericNameProvider.GetParameterCount()) 2041throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidDataContractException(string.Format(SRSerialization.GenericParameterNotValid, format.Substring(start, i - start), genericNameProvider.GetGenericTypeName(), genericNameProvider.GetParameterCount() - 1)));
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\EnumDataContract.cs (1)
436throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(XmlObjectSerializer.CreateSerializationException(string.Format(SRSerialization.InvalidEnumValueOnRead, value.Substring(index, count), DataContract.GetClrTypeFullName(UnderlyingType))));
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\XmlObjectSerializerReadContext.cs (1)
457prefix = qname.Substring(0, colon);
FrameworkFork\System.Runtime.Serialization\System\Xml\XmlBaseReader.cs (2)
558prefix = name.Substring(0, index); 1035prefix = name.Substring(0, index);
FrameworkFork\System.Runtime.Serialization\System\Xml\XmlConverter.cs (2)
494prefix = Trim(qname.Substring(0, index)); 1180return s.Substring(i, j - i);
FrameworkFork\System.ServiceModel\Internals\System\Runtime\UrlUtility.cs (4)
75return UrlPathEncode(str.Substring(0, i)) + str.Substring(i); 533name = s.Substring(si, ti - si); 534value = s.Substring(ti + 1, i - ti - 1); 538value = s.Substring(si, i - si);
FrameworkFork\System.ServiceModel\System\IdentityModel\Claims\X509CertificateClaimSet.cs (2)
459s_identifier = x509ExtensionFormattedString.Substring(0, delimiterIndex); 475s_separator = x509ExtensionFormattedString.Substring(separatorFirstChar, separatorLength);
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\TextMessageEncoder.cs (2)
197charSet = contentType.Substring(charsetValueIndex, semiColonIndex - charsetValueIndex); 203charSet = charSet.Substring(1, charSet.Length - 2);
FrameworkFork\System.ServiceModel\System\ServiceModel\Description\ServiceReflector.cs (2)
64string result = nameEnd > 0 ? t.Name.Substring(0, nameEnd) : t.Name; 931return method.Name.Substring(0, method.Name.Length - AsyncMethodNameSuffix.Length);
FrameworkFork\System.ServiceModel\System\ServiceModel\FaultReason.cs (1)
108localLang = localLang.Substring(0, idx);
FrameworkFork\System.ServiceModel\System\ServiceModel\Security\WSSecurityPolicy.cs (1)
2976message.Substring(0, (MaxLength - Ellipsis.Length) / 2),
FrameworkFork\System.ServiceModel\System\ServiceModel\XmlUtil.cs (3)
62return s.Substring(0, i); 98return s.Substring(i, j - i); 116prefix = TrimStart(qname.Substring(0, index));
Metadata\HttpAuthenticationHelper.cs (1)
101schemesString = challenge.Substring(0, spaceIndex);
Metadata\MetadataFileNameManager.cs (2)
118FileNameFromNS_Add(fileNameBuilder, absoluteUriString.Substring(DataContractXsdBaseNamespace.Length, length).Replace('/', '.')); 131absolutePath = absolutePath.Substring(0, absolutePath.Length - 1);
OutputPathHelper.cs (2)
129absoluteUriString.Substring(s_dataContractXsdBaseNamespaceLength, length).Replace('/', '.')); 141absolutePath = absolutePath.Substring(0, absolutePath.Length - 1);
Shared\FrameworkInfo.cs (2)
50name = fullFrameworkName.Substring(0, i); 69versionString = versionString.Substring(0, versionString.IndexOf("-"));
Shared\MSBuildProj.cs (1)
558basePath = dependency.FullPath.Substring(0, dependency.FullPath.LastIndexOf(Path.DirectorySeparatorChar));
Shared\ProjectDependency.cs (4)
199assemblyName = processedSpec.Substring(0, openingIdx).Trim(); 200processedSpec = processedSpec.Substring(openingIdx + 1, closingIdx - openingIdx - 1).Trim(); 206assemblyName = assemblyName.Substring(0, assemblyName.Length - 1).Trim(); 358version = version.Substring(0, starIdx - 1);
Shared\Utilities\LogTag.cs (1)
62tag = message.Substring(0, LogTag.s_tagLength);
dotnet-svcutil-lib.Tests (1)
ProjectUtils.cs (1)
112csStr = csStr.Replace(csStr.Substring(start, end - start), "string optstring = @\"" + options + "\";\r\n");
dotnet-svcutil.xmlserializer (3)
Microsoft\Tools\ServiceModel\SvcUtil\CommandLineParser.cs (1)
197arg = arg.Substring(0, delim);
Microsoft\Tools\ServiceModel\SvcUtil\OutputModule.cs (2)
180absoluteUriString.Substring(s_dataContractXsdBaseNamespaceLength, length).Replace('/', '.')); 192absolutePath = absolutePath.Substring(0, absolutePath.Length - 1);
dotnet-user-jwts (4)
Helpers\ConsoleTable.cs (1)
122outputRow = string.Concat(outputRow, rows[i][j].Substring(0, columnLengths[j]));
Helpers\SigningKeysHandler.cs (1)
77var shortId = Guid.NewGuid().ToString("N").Substring(0, 8);
src\aspnetcore\src\Shared\CommandLineUtils\CommandLine\AnsiConsole.cs (1)
84var text = message.Substring(escapeScan, escapeIndex - escapeScan);
src\aspnetcore\src\Shared\CommandLineUtils\CommandLine\CommandOption.cs (1)
40ValueName = part.Substring(1, part.Length - 2);
dotnet-user-secrets (2)
src\aspnetcore\src\Shared\CommandLineUtils\CommandLine\AnsiConsole.cs (1)
84var text = message.Substring(escapeScan, escapeIndex - escapeScan);
src\aspnetcore\src\Shared\CommandLineUtils\CommandLine\CommandOption.cs (1)
40ValueName = part.Substring(1, part.Length - 2);
GenerateDocumentationAndConfigFiles (30)
src\roslyn\src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (9)
63s = s.Substring(0, lastSeparator); 181return path.Substring(0, i); 246return path.Substring(0, 1); 282return path.Substring(0, i); 289? path.Substring(0, 3) 290: path.Substring(0, 2); 313? path.Substring(0, 1) 506return path.Substring(0, path.Length - 1); 880var volumeSpecifier = isDriveRooted ? p.Substring(0, 2) : string.Empty;
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\CompilerOptionParseUtilities.cs (1)
61string name = feature.Substring(0, equals);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\FileNameUtilities.cs (2)
118return path.Substring(0, index); 124return path.Substring(0, path.Length - 1);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\StringExtensions.cs (1)
214return arg.Substring(1, arg.Length - 2);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\StringTable.cs (1)
325var text = chars.Substring(start, len);
src\roslyn\src\RoslynAnalyzers\Microsoft.CodeAnalysis.Analyzers\Core\MetaAnalyzers\ReleaseTrackingHelper.cs (1)
77string versionString = lineText[ReleasePrefix.Length..].Trim();
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\WellKnownTypeProvider.cs (1)
224namespaceNamesBuilder.Add(fullTypeName[prevStartIndex..i]);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormattingResult.cs (1)
83var oldText = (change.Span == span) ? originalString : originalString.Substring(change.Span.Start - span.Start, change.Span.Length);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\FormattingExtensions.cs (1)
261newText = newText[i..];
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Naming\IdentifierNameParts.cs (2)
47? newBaseName[prefix.Length..] 77words.Add(name.Substring(part.Start, part.Length));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.cs (8)
147name = StripCommonPrefixes(name[Prefix.Length..], out var prefix); 178=> name.Substring(wordSpan.Start, wordSpan.Length); 311name = StripCommonPrefixes(name.StartsWith(Prefix) ? name[Prefix.Length..] : name, out _); 379return name[index..]; 390name = name[Prefix.Length..^Suffix.Length]; 411newWords[i] = name[parts[i].Start..parts[i].End]; 431return name + Suffix[i..]; 457if (name.StartsWith(Prefix[i..]))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (1)
629var substring = Data[start..end];
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (1)
399return name.Substring(p.Start, p.Length).ToCamelCase();
GetDocument.Insider (2)
src\aspnetcore\src\Shared\CommandLineUtils\CommandLine\AnsiConsole.cs (1)
84var text = message.Substring(escapeScan, escapeIndex - escapeScan);
src\aspnetcore\src\Shared\CommandLineUtils\CommandLine\CommandOption.cs (1)
40ValueName = part.Substring(1, part.Length - 2);
HelixTestTasks (1)
GroupWorkItems.cs (1)
122? name.Substring(0, name.Length - 4)
ILAssembler (3)
GrammarVisitor.cs (2)
1102typeNS = typeFullName.Substring(0, typeFullNameLastDot); 1113typeNS = $"{_currentNamespace.PeekOrDefault()}{typeFullName.Substring(0, typeFullNameLastDot)}";
NameHelpers.cs (1)
25? dottedName.Substring(0, lastDotIndex)
ilc (5)
ConfigurablePInvokePolicy.cs (4)
58string libraryName = entry.Substring(0, separator); 90yield return name.Substring(0, name.Length - suffix.Length); 100yield return name.Substring(0, name.Length - suffix.Length); 104yield return name.Substring(LibPrefix.Length, name.Length - suffix.Length - LibPrefix.Length);
Program.cs (1)
255EcmaModule module = typeSystemContext.GetModuleForSimpleName(specifier.Substring(0, separatorIndex));
ILCompiler.Compiler (11)
Compiler\Disassembler.cs (1)
43dis = dis.Substring(0, dis.Length - 1);
Compiler\Logging\DocumentationSignatureGenerator.PartVisitor.cs (1)
191unmangledName = unmangledName.Substring(0, unmangledName.Length - expectedSuffix.Length);
Compiler\Logging\DocumentationSignatureParser.cs (3)
322typeReference += id.Substring(boundsStartIndex, boundsEndIndex - boundsStartIndex); 538namespacepart = name.Substring(0, indexOfLastDot); 786name = id.Substring(index, delimiterOffset - index);
Compiler\ObjectDumper.cs (2)
28name = name.Substring(0, indexOfAccent); 32name = name.Substring(0, name.Length - 4);
Compiler\RuntimeConfigurationRootProvider.cs (1)
78string key = line.Substring(0, indexOfEquals);
Compiler\UserDefinedTypeDescriptor.cs (1)
93fieldNameEmit = fieldNameEmit.Substring(1, fieldNameEmit.IndexOf('>') - 1);
src\runtime\src\coreclr\tools\Common\Compiler\ProcessLinkerXmlBase.cs (1)
829@namespace = fullName.Substring(0, last_dot);
src\runtime\src\coreclr\tools\Common\Microsoft\SourceLink\Tools\SourceLinkMap.cs (1)
181var escapedPath = string.Join("/", path[file.Path.Length..].Split(['/', '\\']).Select(Uri.EscapeDataString));
ILCompiler.ReadyToRun (7)
Compiler\CallChainProfile.cs (4)
153moduleSimpleName = moduleSimpleName.Substring(0, moduleSimpleName.Length - 3); 168namespaceAndTypeName = unresolvedNamespaceTypeAndMethodName.Substring(0, unresolvedNamespaceTypeAndMethodName.Length - "..ctor".Length); 173namespaceAndTypeName = unresolvedNamespaceTypeAndMethodName.Substring(0, unresolvedNamespaceTypeAndMethodName.Length - "..cctor".Length); 182namespaceAndTypeName = unresolvedNamespaceTypeAndMethodName.Substring(0, lastDotIndex);
Compiler\ReadyToRunCodegenCompilationBuilder.cs (1)
84string name = param.Substring(0, indexOfEquals);
ObjectWriter\MapFileBuilder.cs (1)
304sectionNameHead = sectionNameHead.Substring(0, SectionNameHeadLength);
src\runtime\src\coreclr\tools\Common\Compiler\ProcessLinkerXmlBase.cs (1)
829@namespace = fullName.Substring(0, last_dot);
ILCompiler.RyuJit (1)
Compiler\RyuJitCompilationBuilder.cs (1)
72string name = param.Substring(0, indexOfEquals);
ILCompiler.TypeSystem (1)
src\runtime\src\coreclr\tools\Common\TypeSystem\IL\ILDisassembler.cs (1)
287opCodeString = opCodeString.Substring(0, opCodeString.Length - 1);
illink (14)
ILLink.RoslynAnalyzer (2)
src\runtime\src\libraries\System.Reflection.Metadata\src\System\Reflection\Metadata\TypeName.cs (1)
187_fullName = _fullName.Substring(0, _nestedNameLength);
TrimAnalysis\ParameterProxy.cs (1)
80public partial bool IsTypeOf(string typeName) => ParameterType.IsTypeOf(typeName.Substring(0, typeName.LastIndexOf('.')), typeName.Substring(1 + typeName.LastIndexOf('.')));
ILLink.Tasks (4)
CreateRuntimeRootDescriptorFile.cs (4)
167string lhs = namespaceDefElements[1].Substring(startIndex, namespaceDefElements[1].LastIndexOf('N') - startIndex); 178string prefix = namespaceDefElements[2].Substring(startIndex, namespaceDefElements[2].LastIndexOf('N') - startIndex); 531classNamespace = classNamespace.Substring(0, classNamespace.Length - suffixToRemove.Length); 605defineName = defineName.Substring(0, commentIndex);
Infrastructure.Common (2)
JsonSerializer.cs (1)
43string key = pair.Substring(0, colonPos - 1).Replace("\"", String.Empty).Trim();
ServiceUtilHelper.cs (1)
503builder.Host = serviceUri.Substring(0, pathSeparatorIndex);
Infrastructure.Tests (19)
CITimeline\GenerateCITimelineTests.cs (1)
96var criticalPathSection = summary[criticalPathStart..criticalPathEnd];
Pipelines\NixCliPackageTests.cs (1)
52Assert.Equal(64, Convert.FromBase64String(hash["sha512-".Length..]).Length);
Pipelines\ReleasePublishNugetPipelineTests.cs (7)
98var successTail = pipeline[successIndex..displayNameIndex]; 270return contents[regionStart..regionEnd] 636var runtimeInstall = template[runtimeInstallIndex..wingetCreateInstallIndex]; 637var wingetCreateInstall = template[wingetCreateInstallIndex..submitIndex]; 638var submission = template[submitIndex..]; 688return contents[beginIndex..endIndex]; 773return TrimYamlQuotes(line[valueKey.Length..].Trim());
PowerShellScripts\ScanTestPartitionsFromSourceGuardTests.cs (1)
80var snippet = content.Substring(m.Index, Math.Min(70, content.Length - m.Index))
TestTriggerMap\SelectTestsWorkflowTests.cs (2)
125var mergeBaseRegion = action[resolveStart..resolveEnd]; 152return testsYml[start..end];
TestTriggerMap\TestTriggerMapTests.cs (4)
333.Select(t => "run_" + t["job:".Length..].Replace('-', '_')) 411.Select(t => t["test:".Length..]) 540? workflow.Substring(start, marker.Length + next.Index) 541: workflow[start..];
TypeScriptApiCompat\TypeScriptApiCompatTests.cs (2)
90Assert.Equal(["Pkg.Mode"], surface.EnumTypes.Keys.Select(k => k["enum:".Length..])); 119Assert.Equal(["Aspire.Hosting.Mode"], surface.EnumTypes.Keys.Select(k => k["enum:".Length..]));
WorkflowScripts\SelectTestsCommentScriptTests.cs (1)
290return string.Join("\n", body.Select(l => l.Length >= minIndent ? l[minIndent..] : l));
installer.tasks (1)
StaticFileRegeneration\RegenerateThirdPartyNotices.cs (1)
133$"Existing TPN file preamble: {existingTpn.Preamble.Substring(0, 10)}...");
Microsoft.Analyzers.Extra (1)
LegacyLoggingFixer.FixDetails.cs (1)
281args.Add(message.Substring(openBraceIndex + 1, formatDelimiterIndex - openBraceIndex - 1));
Microsoft.Analyzers.Local (4)
Utils.cs (4)
53return type.Substring(0, whereClauseIndex).Trim(); 76var substring = substrings[1].Substring(0, substrings[1].IndexOf(" where ", StringComparison.Ordinal)); 101results.Add(baseTypesString.Substring(start, i - start).Trim()); 106results.Add(baseTypesString.Substring(start, baseTypesString.Length - start).Trim());
Microsoft.Analyzers.Local.Tests (1)
InternalReferencedInPublicDocAnalyzerTests.cs (1)
471var text = source.Substring(location.SourceSpan.Start, location.SourceSpan.Length);
Microsoft.AspNetCore.App.Analyzers (2)
src\aspnetcore\src\Shared\RoslynUtils\WellKnownTypes.cs (2)
43name = name.Substring(0, separator); 44typeIdName = typeIdName.Substring(0, separator);
Microsoft.AspNetCore.Authentication.BearerToken (1)
BearerTokenHandler.cs (1)
99? authorization["Bearer ".Length..]
Microsoft.AspNetCore.Authentication.Cookies (1)
src\aspnetcore\src\Shared\ChunkingCookieManager\ChunkingCookieManager.cs (1)
207var segment = value.Substring(offset, length);
Microsoft.AspNetCore.Authentication.OpenIdConnect (1)
OpenIdConnectHandler.cs (1)
1197var nonceDecodedValue = Options.StringDataFormat.Unprotect(nonceKey.Substring(Options.NonceCookie.Name.Length, nonceKey.Length - Options.NonceCookie.Name.Length));
Microsoft.AspNetCore.Components (20)
NavigationManager.cs (1)
381baseUri = baseUri.Substring(0, lastSlashIndex + 1);
NavigationManagerExtensions.cs (1)
805return uri.Substring(0, uriWithoutHashLength);
src\aspnetcore\src\Http\Routing\src\ParameterPolicyActivator.cs (2)
81policyKey = inlineParameterPolicy.Substring(0, indexOfFirstOpenParens); 82argumentString = inlineParameterPolicy.Substring(
src\aspnetcore\src\Http\Routing\src\Patterns\RouteParameterParser.cs (11)
63parameterName = parameter.Substring(startIndex, currentIndex - startIndex); 71parameterName = parameter.Substring(startIndex, currentIndex - startIndex + 1); 84defaultValue = parameter.Substring(currentIndex + 1, endIndex - currentIndex); 136var constraintText = text.Substring(startIndex, currentIndex - startIndex); 150constraintText = text.Substring(startIndex, currentIndex - startIndex + 1); 155constraintText = text.Substring(startIndex, currentIndex - startIndex + 1); 161constraintText = text.Substring(startIndex, currentIndex - startIndex + 1); 176constraintText = text.Substring(startIndex, currentIndex - startIndex); 203var constraintText = text.Substring(startIndex, currentIndex - startIndex); 210constraintText = text.Substring(startIndex, currentIndex - startIndex); 222constraintText = text.Substring(startIndex, currentIndex - startIndex);
src\aspnetcore\src\Http\Routing\src\Patterns\RoutePatternParser.cs (5)
209var inside = text.Substring(1, text.Length - 2); 536var value = _template.Substring(_mark.Value, _index - _mark.Value); 554return _template.Substring(0, _mark.Value) + 556_template.Substring(_mark.Value, _index - _mark.Value) + 562return string.Concat(_template.Substring(0, _index), "|", _template.Substring(_index));
Microsoft.AspNetCore.Components.AI.SourceGenerators (1)
ToolBlockEmitter.cs (1)
259=> propertyName.Substring(0, 1).ToLowerInvariant() + propertyName.Substring(1);
Microsoft.AspNetCore.Components.Endpoints (1)
src\aspnetcore\src\Shared\ChunkingCookieManager\ChunkingCookieManager.cs (1)
207var segment = value.Substring(offset, length);
Microsoft.AspNetCore.Components.WebView.Maui (1)
src\BlazorWebView\src\SharedSource\QueryStringHelper.cs (1)
21 : url.Substring(0, indexOfQueryString);
Microsoft.AspNetCore.Components.WebView.WindowsForms (1)
src\BlazorWebView\src\SharedSource\QueryStringHelper.cs (1)
21 : url.Substring(0, indexOfQueryString);
Microsoft.AspNetCore.Components.WebView.Wpf (1)
src\BlazorWebView\src\SharedSource\QueryStringHelper.cs (1)
21 : url.Substring(0, indexOfQueryString);
Microsoft.AspNetCore.DataProtection (1)
TypeForwardingActivator.cs (1)
89return forwardedTypeName.Substring(0, versionStartIndex);
Microsoft.AspNetCore.DeveloperCertificates.XPlat (1)
src\aspnetcore\src\Shared\CertificateGeneration\UnixCertificateManager.cs (1)
361? Path.Combine("$HOME", certDir[homeDirectoryWithSlash.Length..])
Microsoft.AspNetCore.Diagnostics.Middleware.PerformanceTests (2)
RedactionBenchmark.cs (2)
56var routeNonParamameterSegment = httpRoute.Substring(startIndex, startIndexOfParam - startIndex); 57var routeParameterSegment = httpRoute.Substring(startIndexOfParam + 1, endIndexOfParam - startIndexOfParam - 1);
Microsoft.AspNetCore.Grpc.JsonTranscoding (2)
src\aspnetcore\src\Grpc\JsonTranscoding\src\Shared\X509CertificateHelpers.cs (2)
152s_identifier = x509ExtensionFormattedString.Substring(0, delimiterIndex); 168s_separator = x509ExtensionFormattedString.Substring(separatorFirstChar, separatorLength);
Microsoft.AspNetCore.Http (5)
BindingAddress.cs (5)
201var scheme = address.Substring(0, schemeDelimiterStart); 213var portString = address.Substring(portDelimiterEnd, pathDelimiterStart - portDelimiterEnd); 218host = address.Substring(schemeDelimiterEnd, portDelimiterStart - schemeDelimiterEnd); 238host = address.Substring(schemeDelimiterEnd, pathDelimiterStart - schemeDelimiterEnd); 254pathBase = address.Substring(pathDelimiterEnd, address.Length - pathDelimiterEnd - 1);
Microsoft.AspNetCore.Http.Abstractions (4)
Internal\ParsingHelpers.cs (1)
81value = value.Substring(1, value.Length - 2);
PathString.cs (3)
307remaining = new PathString(value1[value2.Length..]); 365matched = new PathString(value1.Substring(0, value2.Length)); 366remaining = new PathString(value1[value2.Length..]);
Microsoft.AspNetCore.Http.Extensions (4)
UriHelper.cs (4)
124scheme = uri.Substring(0, startIndex); 139query = QueryString.FromUriComponent(uri.Substring(searchIndex, limit - searchIndex)); 145path = PathString.FromUriComponent(uri.Substring(searchIndex, limit - searchIndex)); 149host = HostString.FromUriComponent(uri.Substring(startIndex, limit - startIndex));
Microsoft.AspNetCore.Http.RequestDelegateGenerator (2)
src\aspnetcore\src\Shared\RoslynUtils\WellKnownTypes.cs (2)
43name = name.Substring(0, separator); 44typeIdName = typeIdName.Substring(0, separator);
Microsoft.AspNetCore.InternalTesting (1)
Logging\XunitLoggerProvider.cs (1)
100message = message.Substring(0, message.Length - Environment.NewLine.Length);
Microsoft.AspNetCore.Mvc.ApiExplorer (1)
src\aspnetcore\src\Shared\RoslynUtils\TypeHelper.cs (1)
53originalName = generatedName.Substring(startIndex + 4, endIndex - startIndex - 4);
Microsoft.AspNetCore.Mvc.Core (12)
ApplicationModels\AttributeRouteModel.cs (2)
243return result.Substring(startIndex, subStringLength); 405.Substring(tokenStart!.Value, i - tokenStart.Value - 1)
ApplicationModels\DefaultApplicationModelProvider.cs (2)
166typeInfo.Name.Substring(0, typeInfo.Name.Length - "Controller".Length) : 395actionName = actionName.Substring(0, actionName.Length - Suffix.Length);
ModelBinding\PrefixContainer.cs (7)
119key = entry.Substring(1, bracketPosition - 1); 120fullName = entry.Substring(0, bracketPosition + 1); 125key = delimiterPosition == -1 ? entry : entry.Substring(0, delimiterPosition); 154key = entry.Substring(keyPosition, delimiterPosition); 155fullName = entry.Substring(0, delimiterPosition + keyPosition); 168key = entry.Substring(keyPosition, bracketPosition - keyPosition); 169fullName = entry.Substring(0, bracketPosition + 1);
src\aspnetcore\src\Shared\ChunkingCookieManager\ChunkingCookieManager.cs (1)
207var segment = value.Substring(offset, length);
Microsoft.AspNetCore.Mvc.NewtonsoftJson (1)
NewtonsoftJsonInputFormatter.cs (1)
399var propertyName = path.Substring(index, endIndex - index);
Microsoft.AspNetCore.Mvc.Razor (3)
Infrastructure\DefaultFileVersionProvider.cs (1)
45resolvedPath = path.Substring(0, queryStringOrFragmentStartIndex);
TagHelpers\UrlResolutionTagHelper.cs (2)
304trimmed = input.Substring(start, remainingLength); 318return $"~/{src}{value[remainder..]}";
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation (4)
src\aspnetcore\src\Mvc\Mvc.RazorPages\src\ApplicationModels\PageRouteModelFactory.cs (4)
74pageRoute.Substring(0, index); 108var areaName = relativePath.Substring(areaRootEndIndex + 1, areaEndIndex - areaRootEndIndex - 1); 118var viewEnginePath = relativePath.Substring(pageNameIndex, relativePath.Length - pageNameIndex - RazorViewEngine.ViewExtension.Length); 133return path.Substring(startIndex, endIndex - startIndex);
Microsoft.AspNetCore.Mvc.RazorPages (7)
ApplicationModels\DefaultPageApplicationModelPartsProvider.cs (2)
256httpMethod = methodName.Substring(start, handlerNameStart - start); 260handler = handlerNameStart == length ? null : methodName.Substring(handlerNameStart, length - handlerNameStart);
ApplicationModels\PageRouteModelFactory.cs (4)
74pageRoute.Substring(0, index); 108var areaName = relativePath.Substring(areaRootEndIndex + 1, areaEndIndex - areaRootEndIndex - 1); 118var viewEnginePath = relativePath.Substring(pageNameIndex, relativePath.Length - pageNameIndex - RazorViewEngine.ViewExtension.Length); 133return path.Substring(startIndex, endIndex - startIndex);
Infrastructure\PageViewLocationExpander.cs (1)
61yield return location.Replace("/{1}/", context.PageName.Substring(0, end + 1));
Microsoft.AspNetCore.Mvc.TagHelpers (4)
GlobbingUrlBuilder.cs (2)
225var xNoExt = xExtIndex >= 0 ? x.Substring(0, xExtIndex) : x; 226var yNoExt = yExtIndex >= 0 ? y.Substring(0, yExtIndex) : y;
JavaScriptResources.cs (1)
56return input.Substring(0, input.Length - 2);
ResourceCollectionUtilities.cs (1)
35var relativePath = url[length..];
Microsoft.AspNetCore.Mvc.ViewFeatures (2)
ViewComponents\ViewComponentConventions.cs (1)
77return componentType.Name.Substring(0, componentType.Name.Length - ViewComponentSuffix.Length);
ViewDataEvaluator.cs (1)
151return expression.Substring(startIndex: 0, length: lastDot);
Microsoft.AspNetCore.OpenApi (2)
Services\Schemas\OpenApiSchemaService.cs (1)
465referenceId = referenceId[componentsSchemasReferencePrefix.Length..];
src\aspnetcore\src\Shared\RoslynUtils\TypeHelper.cs (1)
53originalName = generatedName.Substring(startIndex + 4, endIndex - startIndex - 4);
Microsoft.AspNetCore.OpenApi.SourceGenerators (2)
XmlCommentGenerator.Parser.cs (1)
42return docId.Substring(0, tildeIndex);
XmlComments\XmlComment.cs (1)
31xml = xml.Substring(5, xml.Length - 11);
Microsoft.AspNetCore.ResponseCompression (1)
ResponseCompressionProvider.cs (1)
201mimeType = mimeType.Substring(0, separator);
Microsoft.AspNetCore.Rewrite (9)
ApacheModRewrite\CookieActionFactory.cs (1)
37SetActionOption(flagValue.Substring(start, length).Trim(), currentField, ref action);
ApacheModRewrite\FlagParser.cs (1)
68var tokens = flagString.Substring(1, flagString.Length - 2).Split(',');
ParserContext.cs (1)
53var value = Template.Substring(_mark.Value, Index - _mark.Value);
RedirectRule.cs (3)
65scheme = newPath.Substring(0, schemeSplit); 76host = new HostString(newPath.Substring(schemeSplit, pathSplit - schemeSplit)); 92resolvedPath = newPath.Substring(0, querySplit);
RewriteRule.cs (1)
73var newPath = result.Substring(0, split);
UrlActions\RedirectAction.cs (1)
65response.Headers.Location = pathBase + pattern.Substring(0, split) + query;
UrlActions\RewriteAction.cs (1)
101var path = pattern.Substring(0, split);
Microsoft.AspNetCore.Routing (32)
InlineRouteParameterParser.cs (11)
64parameterName = routeParameter.Substring(startIndex, currentIndex - startIndex); 72parameterName = routeParameter.Substring(startIndex, currentIndex - startIndex + 1); 85defaultValue = routeParameter.Substring(currentIndex + 1, endIndex - currentIndex); 132var constraintText = routeParameter.Substring(startIndex, currentIndex - startIndex); 146constraintText = routeParameter.Substring(startIndex, currentIndex - startIndex + 1); 151constraintText = routeParameter.Substring(startIndex, currentIndex - startIndex + 1); 157constraintText = routeParameter.Substring(startIndex, currentIndex - startIndex + 1); 172constraintText = routeParameter.Substring(startIndex, currentIndex - startIndex); 199var constraintText = routeParameter.Substring(startIndex, currentIndex - startIndex); 203constraintText = routeParameter.Substring(startIndex, currentIndex - startIndex); 212constraintText = routeParameter.Substring(startIndex, currentIndex - startIndex);
Matching\DfaMatcher.cs (1)
251path.Substring(segment.Start, segment.Length));
ParameterPolicyActivator.cs (2)
81policyKey = inlineParameterPolicy.Substring(0, indexOfFirstOpenParens); 82argumentString = inlineParameterPolicy.Substring(
Patterns\RouteParameterParser.cs (11)
63parameterName = parameter.Substring(startIndex, currentIndex - startIndex); 71parameterName = parameter.Substring(startIndex, currentIndex - startIndex + 1); 84defaultValue = parameter.Substring(currentIndex + 1, endIndex - currentIndex); 136var constraintText = text.Substring(startIndex, currentIndex - startIndex); 150constraintText = text.Substring(startIndex, currentIndex - startIndex + 1); 155constraintText = text.Substring(startIndex, currentIndex - startIndex + 1); 161constraintText = text.Substring(startIndex, currentIndex - startIndex + 1); 176constraintText = text.Substring(startIndex, currentIndex - startIndex); 203var constraintText = text.Substring(startIndex, currentIndex - startIndex); 210constraintText = text.Substring(startIndex, currentIndex - startIndex); 222constraintText = text.Substring(startIndex, currentIndex - startIndex);
Patterns\RoutePatternParser.cs (5)
209var inside = text.Substring(1, text.Length - 2); 536var value = _template.Substring(_mark.Value, _index - _mark.Value); 554return _template.Substring(0, _mark.Value) + 556_template.Substring(_mark.Value, _index - _mark.Value) + 562return string.Concat(_template.Substring(0, _index), "|", _template.Substring(_index));
RouteCollection.cs (1)
162urlWithoutQueryString = url.Substring(0, indexOfSeparator);
src\aspnetcore\src\Shared\RoslynUtils\TypeHelper.cs (1)
53originalName = generatedName.Substring(startIndex + 4, endIndex - startIndex - 4);
Microsoft.AspNetCore.Server.HttpSys (9)
RequestProcessing\Request.cs (3)
102Path = originalPath[pathBase.Length..]; 108Path = originalPath[pathBase.Length..]; 163Path = originalPath[originalOffset..];
src\aspnetcore\src\Shared\HttpSys\RequestProcessing\HeaderParser.cs (2)
36var subValue = value.Substring(start, current - start); 47var subValue = value.Substring(start, current - start);
UrlPrefix.cs (3)
126scheme = whole.Substring(0, schemeDelimiterEnd); 134host = whole.Substring(hostDelimiterStart, hostDelimiterEnd - hostDelimiterStart); 145host = whole.Substring(hostDelimiterStart, pathDelimiterStart - hostDelimiterStart);
UrlPrefixCollection.cs (1)
100pathBase = originalPath.Substring(0, prefix.PathWithoutTrailingSlash.Length); // Maintain the input casing
Microsoft.AspNetCore.Server.IIS (3)
Core\IISHttpContext.cs (1)
268Path = originalPath[originalOffset..];
src\aspnetcore\src\Shared\HttpSys\RequestProcessing\HeaderParser.cs (2)
36var subValue = value.Substring(start, current - start); 47var subValue = value.Substring(start, current - start);
Microsoft.AspNetCore.Server.Kestrel.Core (1)
src\aspnetcore\src\Shared\CertificateGeneration\UnixCertificateManager.cs (1)
361? Path.Combine("$HOME", certDir[homeDirectoryWithSlash.Length..])
Microsoft.AspNetCore.WebUtilities (2)
MultipartReader.cs (2)
124var name = line.Substring(0, splitIndex); 125var value = line.Substring(splitIndex + 1, line.Length - splitIndex - 1).Trim();
Microsoft.Build (42)
BackEnd\Components\Communications\NodeProviderOutOfProcTaskHost.cs (1)
593return int.TryParse(lastDirectoryName.Substring(0, dotIndex), out int majorVersion)
BuildCheck\OM\PropertyReadData.cs (1)
28propertyReadInfo.PropertyName.Substring(propertyReadInfo.StartIndex, propertyReadInfo.EndIndex - propertyReadInfo.StartIndex + 1),
Construction\Solution\SolutionFile.cs (3)
1369string configurationName = propertyName.Substring(0, indexOfFirstDot); 1452string referencedProjectGuid = projectReferenceEntry.Substring(indexOfOpeningBrace, 1482return property.Substring(1, property.Length - 2);
Construction\Solution\SolutionProjectGenerator.cs (2)
1078escapedSolutionFileName = escapedSolutionFileName.Substring(0, escapedSolutionFileName.Length - 1); 2251referencedWebProjectGuid = referencedWebProjectGuid.Substring(0, 38);
Definition\Project.cs (2)
2857string displayValue = escapedValue.Substring(0, Math.Min(escapedValue.Length, 75)) + ((escapedValue.Length > 75) ? "..." : String.Empty); 2864string displayOriginalValue = originalValue.Substring(0, Math.Min(originalValue.Length, 75)) + ((originalValue.Length > 75) ? "..." : String.Empty);
Definition\ProjectCollection.cs (1)
588: fullInformationalVersion.Substring(startIndex: 0, length: plusIndex + 10);
Definition\Toolset.cs (1)
378toolsPathToUse = toolsPathToUse.Substring(0, toolsPathToUse.Length - 1);
Evaluation\Conditionals\Scanner.cs (9)
329return _expression.Substring(start, _parsePoint - start); 467expression = expression.Substring(2, expression.Length - 1 - 2); 569_lookahead = new Token(Token.TokenType.ItemList, _expression.Substring(start, _parsePoint - start)); 602name = _expression.Substring(_parsePoint + 2, endOfName - _parsePoint - 2 + 1); 652string originalTokenString = _expression.Substring(start, _parsePoint - start); 709_lookahead = new Token(Token.TokenType.Function, _expression.Substring(start, end - start)); 713string tokenValue = _expression.Substring(start, end - start); 726_lookahead = new Token(Token.TokenType.Numeric, _expression.Substring(start, _parsePoint - start)); 753_lookahead = new Token(Token.TokenType.Numeric, _expression.Substring(start, _parsePoint - start));
Evaluation\ConditionEvaluator.cs (1)
77rightValueExpandedPiece = rightValueExpanded.Substring(0, indexOfVerticalBar);
Evaluation\Expander.Function.cs (2)
781string candidateAssemblyName = baseName.Substring(0, assemblyNameEnd); 1093parameters = parameters.Substring(0, parameters.Length - 2);
Evaluation\Expander.ItemExpander.Transforms.cs (1)
648string matchValue = quotedExpressionFunction.Substring(pos, refEnd - pos);
Evaluation\Expander.PropertyExpander.cs (4)
180propertyBody = expression.Substring(propertyStartIndex + 2, propertyEndIndex - propertyStartIndex - 2); 204propertyBody = expression.Substring(propertyStartIndex + 2, propertyEndIndex - propertyStartIndex - 2); 475propertyValue = ExpandMSBuildThisFileProperty(propertyName.Substring(startIndex, endIndex - startIndex + 1), elementLocation); 586string registryKeyName = lastAtSignOffset != -1 ? registryLocation.Substring(0, lastAtSignOffset) : registryLocation;
Evaluation\Expander\WellKnownFunctions.cs (1)
288returnVal = text.Substring(startIndex, length);
Evaluation\ExpressionShredder.cs (5)
187transformExpressions.Add(new ItemExpressionCapture(startQuoted, endQuoted - startQuoted, expression.Substring(startQuoted, endQuoted - startQuoted))); 243separator = expression.Substring(currentIndex, closingQuote - currentIndex); 405pair.Items.Add(expression.Substring(startOfName, nameLength)); 642string functionName = expression.Substring(startTransform, endFunctionName - startTransform); 649ItemExpressionCapture capture = new ItemExpressionCapture(startTransform, i - startTransform, expression.Substring(startTransform, i - startTransform), null, null, -1, null, functionName, functionArguments);
Evaluation\IntrinsicFunctions.cs (1)
769basekeyName = keyName.Substring(0, i).ToUpperInvariant();
Evaluation\PropertiesUseTracker.cs (1)
71propertyName: propertyName.Substring(startIndex, endIndex - startIndex + 1),
Evaluation\PropertyTrackingEvaluatorDataWrapper.cs (1)
81this.TrackPropertyRead(name.Substring(startIndex, endIndex - startIndex + 1), prop);
Globbing\MSBuildGlob.cs (1)
138string fixedDirectoryPart = normalizedInput.Substring(0, fixedDirectoryPartLength);
Logging\LogFormatter.cs (1)
52return rawTime.Substring(0, prettyLength);
Logging\TerminalLogger\TerminalLogger.cs (1)
1625? $"{path.Substring(0, index + 1)}{AnsiCodes.MakeBold(path.Substring(index + 1))}"
src\msbuild\src\Shared\CanonicalError.cs (1)
302message = message.Substring(0, 400);
src\msbuild\src\Shared\Debugging\PrintLineDebuggerWriters.cs (1)
80var artifactsPart = executingAssembly.Substring(0, logIndex);
Microsoft.Build.Framework (28)
EscapingUtilities.cs (1)
175: value.Substring(startIndex, endIndex - startIndex);
FileClassifier.cs (1)
325path = path.Substring(0, path.Length - 1);
FileUtilities.cs (3)
227path = path.Substring(0, path.Length - 1); 484return FixFilePath(path.Substring(start, stop - start)); 596return FixFilePath(fullPath.Substring(0, i));
InterningWriteTranslator.cs (1)
146string directory = str.Substring(0, splitId + 1);
MSBuildNameIgnoreCaseComparer.cs (1)
184return StringComparer.OrdinalIgnoreCase.GetHashCode(obj.Substring(start, length));
Telemetry\CrashTelemetry.cs (12)
742? stackTrace.Substring(start, firstDot - start) 743: stackTrace.Substring(start, end - start); 764return cutoff > start ? stackTrace.Substring(start, cutoff - start) : null; 853return message.Length <= maxLength ? message : message.Substring(0, maxLength); 886string topFrame = newLineIndex >= 0 ? stackTrace.Substring(0, newLineIndex) : stackTrace; 907sanitized = sanitized.Substring(0, MaxStackTraceLength - truncationSuffix.Length) + truncationSuffix; 928string firstFrame = (firstNewLine >= 0 ? stackTrace.Substring(0, firstNewLine) : stackTrace).Trim(); 954? stackTrace.Substring(secondStart, secondNewLine - secondStart) 986return frame.Substring(0, inIndex + inToken.Length) + "<redacted>"; 989string prefix = frame.Substring(0, inIndex + inToken.Length); 1016string prefix = line.Substring(0, inIndex + inToken.Length); 1023lines[i] = line.Substring(0, inIndex + inToken.Length) + "<redacted>";
Utilities\FileMatcher.cs (7)
752fixedDirectoryPart = filespec.Substring(0, indexOfLastDirectorySeparator + 1); 761string filespecLeftOfWildcard = filespec.Substring(0, indexOfFirstWildcard); 775wildcardDirectoryPart = filespec.Substring(0, indexOfLastDirectorySeparator + 1); 783fixedDirectoryPart = filespec.Substring(0, indexOfSeparatorBeforeWildCard + 1); 784wildcardDirectoryPart = filespec.Substring(indexOfSeparatorBeforeWildCard + 1, indexOfLastDirectorySeparator - indexOfSeparatorBeforeWildCard); 1262pattern = indexOfNextSlash != -1 ? recursionState.RemainingWildcardDirectory.Substring(0, indexOfNextSlash) : recursionState.RemainingWildcardDirectory; 2299directoryPattern = wildcard.Substring(3, wildcardLength - 6);
Utilities\MessageParser.cs (2)
253code = _text.Substring(start, _position - start); 302code = _text.Substring(start, _position - start);
Microsoft.Build.Tasks.CodeAnalysis (4)
src\roslyn\src\Compilers\Core\MSBuildTask\CanonicalError.cs (1)
267message = message.Substring(0, 400);
src\roslyn\src\Compilers\Core\MSBuildTask\Vbc.cs (2)
352string twoLetterPrefix = originalBaseAddress.Substring(0, 2); 731string? newLine = originalVBErrorString.Substring(0, endParenthesisLocation) + "," + column + originalVBErrorString.Substring(endParenthesisLocation);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\CompilerOptionParseUtilities.cs (1)
61string name = feature.Substring(0, equals);
Microsoft.Build.Tasks.Core (19)
AssemblyDependency\AssemblyInformation.cs (1)
1189v = v.Substring(0, firstNull);
AssemblyDependency\ReferenceTable.cs (2)
810string name = fusionName.Substring(0, firstComma); 858value = fusionName.Substring(position, nextDelimiter);
BootstrapperUtil\BootstrapperBuilder.cs (2)
331productCodes = productCodes.Substring(0, productCodes.Length - 2); 353productCodes = productCodes.Substring(0, productCodes.Length - 2);
CreateManifestResourceName.cs (1)
192conventionDependentUpon = fileNameWithoutExtension.Substring(0, indexJustBeforeCulture) + SourceFileExtension;
ManifestUtil\BaseReference.cs (1)
51path = path.Substring(0, path.Length - Constants.DeployFileExtension.Length);
RedistList.cs (1)
377return i > 0 ? assemblyName.Substring(0, i) : assemblyName;
ResolveManifestFiles.cs (1)
898string simpleName = fusionName.Substring(0, i); // example: "ClassLibrary1, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" -> "ClassLibrary1"
ResourceHandling\MSBuildResXReader.cs (2)
348fileName = stringValue.Substring(1, lastIndexOfQuote - 1); // remove the quotes in" ..... " 364fileName = stringValue.Substring(0, nextSemiColumn);
ResourceHandling\NameUtilities.cs (1)
25return assemblyQualifiedName.Substring(0, commaIndex);
src\msbuild\src\Shared\CanonicalError.cs (1)
302message = message.Substring(0, 400);
src\msbuild\src\Shared\Debugging\PrintLineDebuggerWriters.cs (1)
80var artifactsPart = executingAssembly.Substring(0, logIndex);
src\msbuild\src\Shared\LanguageParser\VisualBasictokenEnumerator.cs (1)
170current.InnerText = identifierOrKeyword.Substring(1, identifierOrKeyword.Length - 2);
System.Design.cs (1)
144args[i] = value.Substring(0, 1024 - 3) + "...";
system.design\stronglytypedresourcebuilder.cs (1)
529commentString = SR.GetString(SR.StringPropertyTruncatedComment, commentString.Substring(0, DocCommentLengthThreshold));
WriteCodeFragment.cs (2)
333var parameterNameKey = key.Substring(0, key.Length - TypeNameSuffix.Length); 364var parameterNameKey = key.Substring(0, key.Length - IsLiteralSuffix.Length);
Microsoft.Build.Tasks.Git (9)
GitDataReader\GitConfig.Reader.cs (2)
318pattern = key.SubsectionName[caseSensitiveGitDirPrefix.Length..]; 323pattern = key.SubsectionName[caseInsensitiveGitDirPrefix.Length..];
GitDataReader\GitIgnore.cs (1)
227glob = line[s..e];
GitDataReader\GitIgnore.Matcher.cs (1)
225lazyRelativePath ??= normalizedPosixPath[patternGroup.ContainingDirectory.Length..] :
GitDataReader\GitReferenceResolver.cs (2)
150var reference = (nextSeparator >= 0) ? line.Substring(separator + 1, nextSeparator - separator - 1) : line[(separator + 1)..]; 252name = reference[refPrefix.Length..];
GitDataReader\GitRepository.cs (1)
444var link = content[GitDirPrefix.Length..].TrimEnd(CharUtils.AsciiWhitespace);
GitOperations.cs (1)
138return (longestPrefixLength >= 0) ? replacement + url[longestPrefixLength..] : url;
src\sourcelink\src\Common\Utilities\UriUtilities.cs (1)
65parts = relativeUrl.Substring(start, end - start + 1).Split(new[] { '/' });
Microsoft.Build.Utilities.Core (2)
src\msbuild\src\Shared\CanonicalError.cs (1)
302message = message.Substring(0, 400);
src\msbuild\src\Shared\Debugging\PrintLineDebuggerWriters.cs (1)
80var artifactsPart = executingAssembly.Substring(0, logIndex);
Microsoft.CodeAnalysis (42)
CommandLine\CommandLineParser.cs (2)
252part.Substring(0, versionParameterDesignatorLength).Equals(versionParameterDesignator, StringComparison.OrdinalIgnoreCase) && 342return i == (length - 1) ? path : path.Substring(0, i + 1);
Compilation\SubsystemVersion.cs (1)
99major = str.Substring(0, index);
Diagnostic\SourceLocation.cs (1)
130return base.GetDebuggerDisplay() + "\"" + _syntaxTree.ToString().Substring(_span.Start, _span.Length) + "\"";
DiagnosticAnalyzer\SuppressMessageAttributeState.TargetSymbolResolver.cs (4)
54return id[prefix.Length..]; 257if (callingConvention == _name.Substring(_index, callingConvention.Length)) 275segment = _name[_index..delimiterOffset]; 280segment = _name[_index..];
DocumentationCommentId.cs (3)
299name = name.Substring(0, name.Length - 6) + "Item"; 316name = name.Substring(0, name.Length - 4) + "this[]"; 1594name = id.Substring(index, delimiterOffset - index);
FileSystem\PathUtilities.cs (9)
63s = s.Substring(0, lastSeparator); 181return path.Substring(0, i); 246return path.Substring(0, 1); 282return path.Substring(0, i); 289? path.Substring(0, 3) 290: path.Substring(0, 2); 313? path.Substring(0, 1) 506return path.Substring(0, path.Length - 1); 880var volumeSpecifier = isDriveRooted ? p.Substring(0, 2) : string.Empty;
InternalUtilities\CompilerOptionParseUtilities.cs (1)
61string name = feature.Substring(0, equals);
InternalUtilities\FileNameUtilities.cs (2)
118return path.Substring(0, index); 124return path.Substring(0, path.Length - 1);
InternalUtilities\StringExtensions.cs (1)
214return arg.Substring(1, arg.Length - 2);
InternalUtilities\StringTable.cs (1)
325var text = chars.Substring(start, len);
MetadataReader\MetadataHelpers.cs (6)
338return _input.Substring(start, _offset - start); 424string name = _input.Substring(_offset, i - _offset); 470typeNameBuilder.Append(_input.Substring(start, _offset - start)); 480typeNameBuilder.Append(_input.Substring(start, _offset - start)); 486typeNameBuilder.Append(_input.Substring(start, _offset - start)); 967return fullName.Substring(parentNamespaceNameLength, index - parentNamespaceNameLength);
MetadataReader\PEModule.cs (2)
841string namespaceName = index >= 0 ? typeName.Substring(0, index) : ""; 860select backtickIndex < 0 ? metadataName : metadataName.Substring(0, backtickIndex);
MetadataReference\AssemblyIdentity.DisplayName.cs (2)
564value = displayName.Substring(valueStart, valueEnd - valueStart); 873int codepoint = Convert.ToInt32(str.Substring(i, semicolon - i), 16);
RealParser.cs (2)
350if (int.TryParse(source.Substring(firstExponent, lastExponent - firstExponent), out exponentMagnitude) && 624var valueString = data.Mantissa.Substring((int)integer_first_index, (int)(integer_last_index - integer_first_index));
src\roslyn\src\Dependencies\CodeAnalysis.Debugging\CustomDebugInfoReader.cs (1)
833before = input.Substring(offset, separatorPos - offset);
Text\StringText.cs (1)
83return this.Source.Substring(span.Start, span.Length);
VersionHelper.cs (1)
128TryGetValue(elements[i].Substring(0, idx), out values[i]);
WellKnownTypes.cs (2)
807name = name.Substring(0, separator); 808typeIdName = typeIdName.Substring(0, separator);
Microsoft.CodeAnalysis.Analyzers (35)
MetaAnalyzers\DiagnosticDescriptorCreationAnalyzer_IdRangeAndCategoryValidation.cs (1)
90var suffix = ruleId[allowedIds.prefix.Length..];
MetaAnalyzers\DiagnosticDescriptorCreationAnalyzer_ResourceStringsFormat.cs (1)
103var value = valueElementStr.Substring(valueTagPrefix.Length, valueLength);
MetaAnalyzers\ReleaseTrackingHelper.cs (1)
77string versionString = lineText[ReleasePrefix.Length..].Trim();
src\roslyn\src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (9)
63s = s.Substring(0, lastSeparator); 181return path.Substring(0, i); 246return path.Substring(0, 1); 282return path.Substring(0, i); 289? path.Substring(0, 3) 290: path.Substring(0, 2); 313? path.Substring(0, 1) 506return path.Substring(0, path.Length - 1); 880var volumeSpecifier = isDriveRooted ? p.Substring(0, 2) : string.Empty;
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\CompilerOptionParseUtilities.cs (1)
61string name = feature.Substring(0, equals);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\FileNameUtilities.cs (2)
118return path.Substring(0, index); 124return path.Substring(0, path.Length - 1);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\StringExtensions.cs (1)
214return arg.Substring(1, arg.Length - 2);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\StringTable.cs (1)
325var text = chars.Substring(start, len);
src\roslyn\src\RoslynAnalyzers\Microsoft.CodeAnalysis.BannedApiAnalyzers\Core\DocumentationCommentIdParser.cs (2)
91name = id[index..delimiterOffset]; 96name = id[index..];
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\WellKnownTypeProvider.cs (1)
224namespaceNamesBuilder.Add(fullTypeName[prevStartIndex..i]);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormattingResult.cs (1)
83var oldText = (change.Span == span) ? originalString : originalString.Substring(change.Span.Start - span.Start, change.Span.Length);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\FormattingExtensions.cs (1)
261newText = newText[i..];
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Naming\IdentifierNameParts.cs (2)
47? newBaseName[prefix.Length..] 77words.Add(name.Substring(part.Start, part.Length));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.cs (8)
147name = StripCommonPrefixes(name[Prefix.Length..], out var prefix); 178=> name.Substring(wordSpan.Start, wordSpan.Length); 311name = StripCommonPrefixes(name.StartsWith(Prefix) ? name[Prefix.Length..] : name, out _); 379return name[index..]; 390name = name[Prefix.Length..^Suffix.Length]; 411newWords[i] = name[parts[i].Start..parts[i].End]; 431return name + Suffix[i..]; 457if (name.StartsWith(Prefix[i..]))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.cs (1)
344foreach (var ch in _symbolKeyData[position..])
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (1)
629var substring = Data[start..end];
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (1)
399return name.Substring(p.Start, p.Length).ToCamelCase();
Microsoft.CodeAnalysis.AnalyzerUtilities (29)
src\roslyn\src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (9)
63s = s.Substring(0, lastSeparator); 181return path.Substring(0, i); 246return path.Substring(0, 1); 282return path.Substring(0, i); 289? path.Substring(0, 3) 290: path.Substring(0, 2); 313? path.Substring(0, 1) 506return path.Substring(0, path.Length - 1); 880var volumeSpecifier = isDriveRooted ? p.Substring(0, 2) : string.Empty;
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\CompilerOptionParseUtilities.cs (1)
61string name = feature.Substring(0, equals);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\FileNameUtilities.cs (2)
118return path.Substring(0, index); 124return path.Substring(0, path.Length - 1);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\StringExtensions.cs (1)
214return arg.Substring(1, arg.Length - 2);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\StringTable.cs (1)
325var text = chars.Substring(start, len);
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\WellKnownTypeProvider.cs (1)
224namespaceNamesBuilder.Add(fullTypeName[prevStartIndex..i]);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormattingResult.cs (1)
83var oldText = (change.Span == span) ? originalString : originalString.Substring(change.Span.Start - span.Start, change.Span.Length);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\FormattingExtensions.cs (1)
261newText = newText[i..];
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Naming\IdentifierNameParts.cs (2)
47? newBaseName[prefix.Length..] 77words.Add(name.Substring(part.Start, part.Length));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.cs (8)
147name = StripCommonPrefixes(name[Prefix.Length..], out var prefix); 178=> name.Substring(wordSpan.Start, wordSpan.Length); 311name = StripCommonPrefixes(name.StartsWith(Prefix) ? name[Prefix.Length..] : name, out _); 379return name[index..]; 390name = name[Prefix.Length..^Suffix.Length]; 411newWords[i] = name[parts[i].Start..parts[i].End]; 431return name + Suffix[i..]; 457if (name.StartsWith(Prefix[i..]))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.cs (1)
344foreach (var ch in _symbolKeyData[position..])
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (1)
629var substring = Data[start..end];
Microsoft.CodeAnalysis.CodeStyle (35)
src\roslyn\src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (2)
311? id[CompilerErrorCodePrefix.Length..] 377trimmedPart = trimmedPart[categoryPrefix.Length..].Trim();
src\roslyn\src\Analyzers\Core\Analyzers\RemoveUnusedMembers\AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (1)
1086var suffix = methodSymbol.Name[prefix.Length..];
src\roslyn\src\Compilers\Core\Portable\DiagnosticAnalyzer\SuppressMessageAttributeState.TargetSymbolResolver.cs (4)
54return id[prefix.Length..]; 257if (callingConvention == _name.Substring(_index, callingConvention.Length)) 275segment = _name[_index..delimiterOffset]; 280segment = _name[_index..];
src\roslyn\src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (9)
63s = s.Substring(0, lastSeparator); 181return path.Substring(0, i); 246return path.Substring(0, 1); 282return path.Substring(0, i); 289? path.Substring(0, 3) 290: path.Substring(0, 2); 313? path.Substring(0, 1) 506return path.Substring(0, path.Length - 1); 880var volumeSpecifier = isDriveRooted ? p.Substring(0, 2) : string.Empty;
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\CompilerOptionParseUtilities.cs (1)
61string name = feature.Substring(0, equals);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\FileNameUtilities.cs (2)
118return path.Substring(0, index); 124return path.Substring(0, path.Length - 1);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\StringExtensions.cs (1)
214return arg.Substring(1, arg.Length - 2);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\StringTable.cs (1)
325var text = chars.Substring(start, len);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormattingResult.cs (1)
83var oldText = (change.Span == span) ? originalString : originalString.Substring(change.Span.Start - span.Start, change.Span.Length);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\FormattingExtensions.cs (1)
261newText = newText[i..];
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Naming\IdentifierNameParts.cs (2)
47? newBaseName[prefix.Length..] 77words.Add(name.Substring(part.Start, part.Length));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.cs (8)
147name = StripCommonPrefixes(name[Prefix.Length..], out var prefix); 178=> name.Substring(wordSpan.Start, wordSpan.Length); 311name = StripCommonPrefixes(name.StartsWith(Prefix) ? name[Prefix.Length..] : name, out _); 379return name[index..]; 390name = name[Prefix.Length..^Suffix.Length]; 411newWords[i] = name[parts[i].Start..parts[i].End]; 431return name + Suffix[i..]; 457if (name.StartsWith(Prefix[i..]))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.cs (1)
344foreach (var ch in _symbolKeyData[position..])
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (1)
629var substring = Data[start..end];
Microsoft.CodeAnalysis.CodeStyle.Fixes (2)
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateConstructor\GenerateConstructorHelpers.cs (1)
218var fieldNameMinusPrefix = newFieldName[fieldNamingRule.NamingStyle.Prefix.Length..];
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (1)
399return name.Substring(p.Start, p.Length).ToCamelCase();
Microsoft.CodeAnalysis.CSharp (24)
Binder\Binder.cs (2)
1013snippet = first.Substring(0, Math.Min(first.Length, 12)) + " ... " + last.Substring(last.Length - lastSize, lastSize);
Compiler\DocumentationCommentCompiler.cs (3)
1152trimmed = trimmed.Substring(0, index); 1182return seenStar ? line.Substring(0, length) : null; 1197return str1.Substring(0, pos);
Parser\DirectiveParser.cs (1)
856string identifierPart = text.Substring(0, MAX_DIRECTIVE_IDENTIFIER_WIDTH);
Parser\LanguageParser_InterpolatedString.cs (10)
86return originalText[startIndex..]; 187originalText[openQuoteRange], 359originalText[closeQuoteRange], 499var expressionText = text[interpolation.OpenBraceRange.End..followingRange.Start]; 512SyntaxFactory.Token(leading: null, SyntaxKind.OpenBraceToken, text[interpolation.OpenBraceRange], openTokenTrailingTrivia)); 514Debug.Assert(text[interpolation.OpenBraceRange.Start..interpolation.CloseBraceRange.End] == result.ToFullString()); // yield from text equals yield from node 529Debug.Assert(text[interpolation.OpenBraceRange.Start..interpolation.CloseBraceRange.End] == result.ToFullString()); // yield from text equals yield from node 554SyntaxFactory.Token(leading, SyntaxKind.ColonToken, text[interpolation.ColonRange], trailing: null), 555MakeInterpolatedStringTextToken(kind, text[interpolation.ColonRange.End..interpolation.CloseBraceRange.Start])); 569text[interpolation.CloseBraceRange],
Parser\Lexer.cs (1)
1600Debug.Assert(string.Equals(info.Text.Substring(0, objectAddressOffset + 1), "@0x", StringComparison.OrdinalIgnoreCase));
SymbolDisplay\SymbolDisplayVisitor.Members.cs (1)
628Builder.Add(CreatePart(SymbolDisplayPartKind.ClassName, conventionType, conventionType.Name[CallConvLength..]));
Symbols\Source\SourceNamedTypeSymbol_Extension.cs (1)
779builder.Append(callingConventionTypes[i].Name["CallConv".Length..]);
Symbols\Synthesized\GeneratedNameParser.cs (4)
103methodName = generatedName.Substring(openBracketOffset + 1, closeBracketOffset - openBracketOffset - 1); 138localFunctionName = generatedName.Substring(localFunctionNameStart, localFunctionNameEnd - localFunctionNameStart); 169propertyName = typeParameterName.Substring(1, typeParameterName.Length - 9); 184parameterName = fieldName.Substring(1, fieldName.Length - 3);
Symbols\Synthesized\GeneratedNames.cs (1)
437var refKindString = name[DelegateNamePrefixLengthWithOpenBrace..nameEndIndex];
Microsoft.CodeAnalysis.CSharp.CodeStyle (2)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\Trivia\TriviaRewriter.cs (1)
93var leadingTrivia = SyntaxFactory.ParseLeadingTrivia(text[width..]);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\FormattingHelpers.cs (1)
31indent = indent[start..];
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (3)
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpCollectionExpressionRewriter.cs (1)
712? preferredIndentation + positionIndentation[firstTokenOnLineIndentationString.Length..]
src\roslyn\src\Analyzers\CSharp\CodeFixes\UsePrimaryConstructor\CSharpUsePrimaryConstructorCodeFixProvider.cs (1)
353var indentation = constructorLeadingWhitespace[typeLeadingWhitespace.Length..];
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeSymbolExtensions.TypeSyntaxGeneratorVisitor.cs (1)
153? null : symbol.Signature.UnmanagedCallingConventionTypes.Select(type => GetConventionForString(type.Name["CallConv".Length..])),
Microsoft.CodeAnalysis.CSharp.Features (13)
CodeLens\CSharpCodeLensDisplayInfoService.cs (2)
116displayName[openParenIndex..]; 128displayName[openBracketIndex..] +
Completion\CompletionProviders\DeclarationName\DeclarationNameRecommender.NameGenerator.cs (1)
85var text = baseName.Substring(@break.Start, @break.Length);
Completion\CompletionProviders\ExplicitInterfaceMemberCompletionProvider.cs (1)
121return (memberString[0..i], memberString[i..]);
Completion\CompletionProviders\FunctionPointerUnmanagedCallingConventionCompletionProvider.cs (1)
111var displayName = type.Name[CallConvPrefix.Length..];
ConvertPrimaryToRegularConstructor\ConvertPrimaryToRegularConstructorCodeRefactoringProvider.cs (1)
433var indentation = constructorLeadingWhitespace[typeLeadingWhitespace.Length..];
ConvertToInterpolatedString\CSharpConvertConcatenationToInterpolatedStringRefactoringProvider.cs (2)
26? text["@'".Length..^1] 27: text["'".Length..^1];
ConvertToRawString\ConvertInterpolatedStringToRawStringCodeRefactoringProvider.cs (1)
331? indentation + positionIndentation[anchorIndentation.Length..]
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpCollectionExpressionRewriter.cs (1)
712? preferredIndentation + positionIndentation[firstTokenOnLineIndentationString.Length..]
src\roslyn\src\Analyzers\CSharp\CodeFixes\UsePrimaryConstructor\CSharpUsePrimaryConstructorCodeFixProvider.cs (1)
353var indentation = constructorLeadingWhitespace[typeLeadingWhitespace.Length..];
Structure\CSharpStructureHelpers.cs (1)
114return prefix + " " + text[prefixLength..].Trim() + " " + Ellipsis;
TaskList\CSharpTaskListService.cs (1)
42AppendTaskListItemsOnSingleLine(commentDescriptors, document, message[index..], start, items);
Microsoft.CodeAnalysis.CSharp.Workspaces (3)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\Trivia\TriviaRewriter.cs (1)
93var leadingTrivia = SyntaxFactory.ParseLeadingTrivia(text[width..]);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\FormattingHelpers.cs (1)
31indent = indent[start..];
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeSymbolExtensions.TypeSyntaxGeneratorVisitor.cs (1)
153? null : symbol.Signature.UnmanagedCallingConventionTypes.Select(type => GetConventionForString(type.Name["CallConv".Length..])),
Microsoft.CodeAnalysis.Extensions.Package (1)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\StringExtensions.cs (1)
214return arg.Substring(1, arg.Length - 2);
Microsoft.CodeAnalysis.Features (30)
CodeFixes\Configuration\ConfigurationUpdater.cs (2)
527var diagId = key.Substring(DiagnosticOptionPrefix.Length, diagIdLength); 545var category = key.Substring(BulkConfigureAnalyzerDiagnosticsByCategoryOptionPrefix.Length, categoryLength);
Completion\Providers\Scripting\AbstractDirectivePathCompletionProvider.cs (1)
101var path = quotedPath[QuoteLength..positionInQuotedPath].Trim();
Completion\Providers\SymbolCompletionItem.cs (2)
286var projectGuid = Guid.Parse(projectIds.Substring(start, current - start)); 298var projectGuid = Guid.Parse(projectIds.Substring(start, current - start));
ConvertToInterpolatedString\ConvertRegularStringToInterpolatedStringRefactoringProvider.cs (1)
87return text[startIndex..^1];
DocumentationComments\CopilotDocumentationCommentGenerator.cs (3)
65var parameterName = comments.Substring(typeParamNameStart, typeParamNameEnd - typeParamNameStart); 86var parameterName = comments.Substring(paramNameStart, paramNameEnd - paramNameStart); 113var exceptionName = comments.Substring(exceptionNameStart, exceptionNameEnd - exceptionNameStart);
EditAndContinue\EditAndContinueDiagnosticDescriptors.cs (1)
276=> IsRudeEdit(diagnosticId) && int.TryParse(diagnosticId[RudeEditDiagnosticIdPrefix.Length..], out var id) ? (RudeEditKind)id : RudeEditKind.None;
EditAndContinue\Utilities\Extensions.cs (1)
233parameterName = fieldName.Substring(1, closing - 1);
GenerateType\AbstractGenerateTypeService.Editor.cs (2)
172namespaceToGenerateInto = namespaceToGenerateInto[rootNamespace.Length..]; 214namespaceToGenerateInto = namespaceToGenerateInto[rootNamespaceLength..];
MetadataAsSource\DocumentationCommentUtilities.cs (1)
25str = str[docCommentPrefix.Length..];
NavigateTo\RegexPatternDetector.cs (1)
99return (pattern[..containerEnd], pattern[nameStart..]);
PdbSourceDocument\SourceLinkMap.cs (1)
194var escapedPath = string.Join("/", path[file.Path.Length..].Split(['/', '\\']).Select(Uri.EscapeDataString));
ReplaceMethodWithProperty\ReplaceMethodWithPropertyCodeRefactoringProvider.cs (2)
63methodName[GetPrefix.Length..], 99var setMethodName = "Set" + getMethod.Name[GetPrefix.Length..];
Snippets\SnippetFunctionService.cs (1)
117param = xmlFunctionText.Substring(paramStart, paramLength);
Snippets\SnippetProviders\AbstractTypeSnippetProvider.cs (1)
55: [new SnippetPlaceholder(identifier.Text[prefix.Length..], identifier.SpanStart + prefix.Length)];
src\roslyn\src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (2)
311? id[CompilerErrorCodePrefix.Length..] 377trimmedPart = trimmedPart[categoryPrefix.Length..].Trim();
src\roslyn\src\Analyzers\Core\Analyzers\RemoveUnusedMembers\AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (1)
1086var suffix = methodSymbol.Name[prefix.Length..];
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateConstructor\GenerateConstructorHelpers.cs (1)
218var fieldNameMinusPrefix = newFieldName[fieldNamingRule.NamingStyle.Prefix.Length..];
src\roslyn\src\Compilers\Core\Portable\DiagnosticAnalyzer\SuppressMessageAttributeState.TargetSymbolResolver.cs (4)
54return id[prefix.Length..]; 257if (callingConvention == _name.Substring(_index, callingConvention.Length)) 275segment = _name[_index..delimiterOffset]; 280segment = _name[_index..];
src\roslyn\src\Dependencies\CodeAnalysis.Debugging\CustomDebugInfoReader.cs (1)
833before = input.Substring(offset, separatorPos - offset);
TaskList\AbstractTaskListService.cs (1)
106var trimmedMessage = message[index..];
Microsoft.CodeAnalysis.NetAnalyzers (7)
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\MarkAttributesWithAttributeUsage.Fixer.cs (1)
87string value = equivalenceKey[Prefix.Length..];
Microsoft.NetCore.Analyzers\InteropServices\PlatformCompatibilityAnalyzer.cs (2)
275platformName = methodName.Substring(2, methodName.Length - 2 - OptionalSuffix.Length); 2125if (i > 0 && Version.TryParse(osString[i..], out Version? parsedVersion))
Microsoft.NetCore.Analyzers\InteropServices\UseValidPlatformString.cs (2)
245versionPart = osString[i..]; 246if (i > 0 && Version.TryParse(osString[i..], out Version _))
Microsoft.NetCore.Analyzers\Runtime\LogValuesFormatter.cs (1)
48ValueNames.Add(format.Substring(openBraceIndex + 1, formatDelimiterIndex - openBraceIndex - 1));
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\Compiler\WellKnownTypeProvider.cs (1)
278namespaceNamesBuilder.Add(fullTypeName[prevStartIndex..i]);
Microsoft.CodeAnalysis.Razor.Compiler (14)
Language\Components\ComponentBindLoweringPass.cs (1)
711valueAttributeName = attributeName["bind-".Length..];
Language\Components\ComponentTildePathPass.cs (1)
180var path = content[TildePrefix.Length..];
Language\Legacy\LanguageCharacteristics.cs (1)
90var left = CreateToken(token.Content.Substring(0, splitAt), leftType, Array.Empty<RazorDiagnostic>());
Language\MarkupSplitter.Slicing.cs (1)
113var slicedContent = content.Substring(localStart, localLength);
Language\RazorProjectItem.cs (1)
117return FilePath.Substring(0, index);
Language\SourceChange.cs (1)
111return node.GetContent().Substring(offset, Span.Length);
Language\VirtualRazorProjectFileSystem.cs (1)
148var directoryPath = path.Substring(0, index + 1); // + 1 to include trailing slash
Mvc.Version1_X\ViewComponentTagHelperDescriptorFactory.cs (1)
265return componentType.Name.Substring(0, componentType.Name.Length - ViewComponentTypes.ViewComponentSuffix.Length);
Mvc.Version2_X\NamespaceDirective.cs (1)
150return path.Substring(0, lastSeparator + 1);
Mvc.Version2_X\ViewComponentTagHelperDescriptorFactory.cs (1)
280return componentType.Name.Substring(0, componentType.Name.Length - ViewComponentTypes.ViewComponentSuffix.Length);
Mvc\PageDirective.cs (1)
86return content.Substring(1, content.Length - 2);
Mvc\ViewComponentTagHelperDescriptorFactory.cs (1)
283return componentType.Name.Substring(0, componentType.Name.Length - ViewComponentTypes.ViewComponentSuffix.Length);
SourceGenerators\RazorSourceGenerator.Helpers.cs (1)
77? implHintName.Substring(0, implHintName.Length - ImplSuffix.Length) + DeclSuffix
SourceGenerators\RazorSourceGenerator.RazorProviders.cs (1)
126relativePath = additionalText.Path[projectPath.Length..].TrimStart(['/', '\\']);
Microsoft.CodeAnalysis.Rebuild (1)
RebuildSourceReferenceResolver.cs (1)
57var root = baseFilePath.Substring(0, index);
Microsoft.CodeAnalysis.ResxSourceGenerator (31)
AbstractResxGenerator.cs (2)
466var docCommentString = value.Length > maxDocCommentLength ? value.Substring(0, maxDocCommentLength) + " ..." : value; 842namespaceName = fullName.Substring(0, lastDot);
src\roslyn\src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (9)
63s = s.Substring(0, lastSeparator); 181return path.Substring(0, i); 246return path.Substring(0, 1); 282return path.Substring(0, i); 289? path.Substring(0, 3) 290: path.Substring(0, 2); 313? path.Substring(0, 1) 506return path.Substring(0, path.Length - 1); 880var volumeSpecifier = isDriveRooted ? p.Substring(0, 2) : string.Empty;
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\CompilerOptionParseUtilities.cs (1)
61string name = feature.Substring(0, equals);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\FileNameUtilities.cs (2)
118return path.Substring(0, index); 124return path.Substring(0, path.Length - 1);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\StringExtensions.cs (1)
214return arg.Substring(1, arg.Length - 2);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\StringTable.cs (1)
325var text = chars.Substring(start, len);
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\WellKnownTypeProvider.cs (1)
224namespaceNamesBuilder.Add(fullTypeName[prevStartIndex..i]);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormattingResult.cs (1)
83var oldText = (change.Span == span) ? originalString : originalString.Substring(change.Span.Start - span.Start, change.Span.Length);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\FormattingExtensions.cs (1)
261newText = newText[i..];
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Naming\IdentifierNameParts.cs (2)
47? newBaseName[prefix.Length..] 77words.Add(name.Substring(part.Start, part.Length));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.cs (8)
147name = StripCommonPrefixes(name[Prefix.Length..], out var prefix); 178=> name.Substring(wordSpan.Start, wordSpan.Length); 311name = StripCommonPrefixes(name.StartsWith(Prefix) ? name[Prefix.Length..] : name, out _); 379return name[index..]; 390name = name[Prefix.Length..^Suffix.Length]; 411newWords[i] = name[parts[i].Start..parts[i].End]; 431return name + Suffix[i..]; 457if (name.StartsWith(Prefix[i..]))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.cs (1)
344foreach (var ch in _symbolKeyData[position..])
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (1)
629var substring = Data[start..end];
Microsoft.CodeAnalysis.Scripting (2)
Hosting\ObjectFormatter\ObjectFormatterHelpers.cs (1)
452return str.Substring(start, i - start + 1);
Hosting\Resolvers\NuGetPackageResolver.cs (1)
24var parts = reference[ReferencePrefix.Length..].Split('/');
Microsoft.CodeAnalysis.VisualBasic (15)
Binding\Binder_Symbols.vb (1)
388currDiagName = currDiagName.Substring(0, currDiagName.LastIndexOf("."c))
CommandLine\VisualBasicCommandLineParser.vb (3)
829AddDiagnostic(diagnostics, ERRID.ERR_SwitchNeedsBool, name.Substring(0, name.Length - 1)) 838AddDiagnostic(diagnostics, ERRID.ERR_SwitchNeedsBool, name.Substring(0, name.Length - 1)) 1059AddDiagnostic(diagnostics, ERRID.ERR_SwitchNeedsBool, name.Substring(0, name.Length - 1))
Declarations\DeclarationTreeBuilder.vb (1)
286Return identifier.Substring(1, identifier.Length - 2)
GlobalImport.ImportDiagnosticInfo.vb (1)
23Return String.Format(formatProvider, msg, _importText, _importText.Substring(_startIndex, _length), _wrappedDiagnostic.GetMessage(formatProvider))
Parser\Parser.vb (3)
5416Dim lessThanText = tokenText.Substring(0, 1) 5417Dim greaterThanText = tokenText.Substring(tokenLength - 1, 1) 5418Dim separatorTrivia = If(tokenLength > 2, _scanner.MakeWhiteSpaceTrivia(tokenText.Substring(1, tokenLength - 2)), Nothing)
Scanner\Scanner.vb (1)
1656Dim baseText = spelling.Substring(1, idStringLength)
Semantics\Operators.vb (1)
81If name.Length > 3 AndAlso IdentifierComparison.Equals("op_", name.Substring(0, 3)) AndAlso s_operatorNames.TryGetValue(name, result) Then
SymbolDisplay\SymbolDisplayVisitor.vb (1)
219myCaseCorrectedParentNSName = emittedName.Substring(0, nsIdx)
Symbols\AnonymousTypes\AnonymousTypeManager_Templates.vb (1)
226moduleId = moduleId.Substring(0, moduleId.Length - extension.Length)
Symbols\Source\QuickAttributeChecker.vb (1)
48_nameToAttributeMap(name.Substring(0, name.Length - "Attribute".Length)) = newAttributes Or current
Symbols\SynthesizedSymbols\GeneratedNameParser.vb (1)
103variableName = proxyName.Substring(prefixLen, separator - prefixLen)
Microsoft.CodeAnalysis.VisualBasic.CodeStyle (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Formatting\Engine\Trivia\TriviaDataFactory.vb (1)
116Debug.Assert(originalString.Substring(0, 4) = " _" & vbCrLf)
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (6)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\EnumMemberGenerator.vb (4)
108Dim firstTwoChars = numericText.Substring(0, 2) 114Dim lastTwoChars = numericText.Substring(numericText.Length - 2, 2) 127Return SyntaxFactory.NumericLiteralExpression(SyntaxFactory.IntegerLiteralToken(numericText.Substring(0, 2) + Convert.ToString(value, 8), LiteralBase.Octal, TypeCharacter.None, IntegerUtilities.ToUnsigned(value))) 129Return SyntaxFactory.NumericLiteralExpression(SyntaxFactory.IntegerLiteralToken(numericText.Substring(0, 2) + Convert.ToString(value, 2), LiteralBase.Binary, TypeCharacter.None, IntegerUtilities.ToUnsigned(value)))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\StringExtensions.vb (2)
26withoutSuffix = identifierText.Substring(0, identifierText.Length - 9) 68unescaped = text.Substring(1, text.Length() - 2)
Microsoft.CodeAnalysis.VisualBasic.Features (10)
CodeLens\VisualBasicDisplayInfoService.vb (1)
112Dim symbolNameWithNoParams As String = symbolName.Substring(0, openParenIndex)
Completion\CompletionProviders\CompletionUtilities.vb (2)
132Return insertionText.Substring(0, insertionText.IndexOf("("c)) 146Return insertionText.Substring(0, insertionText.Length - 1)
Completion\CompletionProviders\NamedParameterCompletionProvider.vb (2)
202change = New TextChange(symbolItem.Span, insertionText.Substring(0, insertionText.Length - s_colonEquals.Length)) 204change = New TextChange(selectedItem.Span, insertionText.Substring(0, insertionText.Length - (s_colonEquals.Length - 1)))
ConvertToInterpolatedString\VisualBasicConvertConcatenationToInterpolatedStringRefactoringProvider.vb (2)
28Return text.Substring("'".Length, text.Length - "''C".Length) 30Return text.Substring("'".Length, text.Length - "''".Length)
ExtractMethod\VisualBasicMethodExtractor.VisualBasicCodeGenerator.vb (1)
390Dim unescaped = name.Substring(1, name.Length() - 2)
SpellCheck\VisualBasicSpellCheckCodeFixProvider.vb (1)
75newName = If(index < 0, newName, newName.Substring(0, index))
TaskList\VisualBasicTaskListService.vb (1)
58Dim remText = message.Substring(index, "REM".Length)
Microsoft.CodeAnalysis.VisualBasic.NetAnalyzers (1)
Microsoft.NetCore.Analyzers\Runtime\BasicForwardCancellationTokenToInvocationsFixer.TypeNameVisitor.vb (1)
198unescaped = text.Substring(1, text.Length() - 2)
Microsoft.CodeAnalysis.VisualBasic.Workspaces (13)
CaseCorrection\VisualBasicCaseCorrectionService.Rewriter.vb (3)
218Return symbol.Name.Substring(0, symbol.Name.Length - s_attributeSuffix.Length) 293Dim expectedText = actualText.Substring(0, actualText.Length - 1) & "c" 305Dim remText = trivia.ToString().Substring(0, 3)
CodeCleanup\Providers\ReduceTokensCodeCleanupProvider.vb (1)
202Dim significantDigitsStr = valueText.Substring(0, exponentIndex)
Rename\VisualBasicRenameRewriterLanguageService.vb (2)
307Dim prefix = If(isRenameLocation AndAlso Me._renameLocations(token.Span).IsRenamableAccessor, newToken.ValueText.Substring(0, newToken.ValueText.IndexOf("_"c) + 1), String.Empty) 988Dim conflict = replacementText.Substring(0, replacementText.Length - AttributeSuffixLength)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Formatting\Engine\Trivia\TriviaDataFactory.vb (1)
116Debug.Assert(originalString.Substring(0, 4) = " _" & vbCrLf)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\EnumMemberGenerator.vb (4)
108Dim firstTwoChars = numericText.Substring(0, 2) 114Dim lastTwoChars = numericText.Substring(numericText.Length - 2, 2) 127Return SyntaxFactory.NumericLiteralExpression(SyntaxFactory.IntegerLiteralToken(numericText.Substring(0, 2) + Convert.ToString(value, 8), LiteralBase.Octal, TypeCharacter.None, IntegerUtilities.ToUnsigned(value))) 129Return SyntaxFactory.NumericLiteralExpression(SyntaxFactory.IntegerLiteralToken(numericText.Substring(0, 2) + Convert.ToString(value, 2), LiteralBase.Binary, TypeCharacter.None, IntegerUtilities.ToUnsigned(value)))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\StringExtensions.vb (2)
26withoutSuffix = identifierText.Substring(0, identifierText.Length - 9) 68unescaped = text.Substring(1, text.Length() - 2)
Microsoft.CodeAnalysis.Workspaces (34)
Log\WorkspaceStructureLogger.cs (1)
236s = s.Substring(0, index) + newValue + s.Substring(index + oldValue.Length);
PatternMatching\PatternMatcher.PatternSegment.cs (2)
99result[resultIndex++] = new TextChunk(pattern.Substring(wordStart, wordLength)); 107result[resultIndex++] = new TextChunk(pattern.Substring(wordStart, wordLength));
Rename\RenameUtilities.cs (3)
306if (replaceInsideString.Substring(subSpan.Start, subSpan.Length) != matchText) 311stringBuilder.Append(replaceInsideString.Substring(startOffset, offset)); 321stringBuilder.Append(replaceInsideString[startOffset..]);
src\roslyn\src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (9)
63s = s.Substring(0, lastSeparator); 181return path.Substring(0, i); 246return path.Substring(0, 1); 282return path.Substring(0, i); 289? path.Substring(0, 3) 290: path.Substring(0, 2); 313? path.Substring(0, 1) 506return path.Substring(0, path.Length - 1); 880var volumeSpecifier = isDriveRooted ? p.Substring(0, 2) : string.Empty;
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\CompilerOptionParseUtilities.cs (1)
61string name = feature.Substring(0, equals);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\FileNameUtilities.cs (2)
118return path.Substring(0, index); 124return path.Substring(0, path.Length - 1);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\StringExtensions.cs (1)
214return arg.Substring(1, arg.Length - 2);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\StringTable.cs (1)
325var text = chars.Substring(start, len);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormattingResult.cs (1)
83var oldText = (change.Span == span) ? originalString : originalString.Substring(change.Span.Start - span.Start, change.Span.Length);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\FormattingExtensions.cs (1)
261newText = newText[i..];
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Naming\IdentifierNameParts.cs (2)
47? newBaseName[prefix.Length..] 77words.Add(name.Substring(part.Start, part.Length));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.cs (8)
147name = StripCommonPrefixes(name[Prefix.Length..], out var prefix); 178=> name.Substring(wordSpan.Start, wordSpan.Length); 311name = StripCommonPrefixes(name.StartsWith(Prefix) ? name[Prefix.Length..] : name, out _); 379return name[index..]; 390name = name[Prefix.Length..^Suffix.Length]; 411newWords[i] = name[parts[i].Start..parts[i].End]; 431return name + Suffix[i..]; 457if (name.StartsWith(Prefix[i..]))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (1)
629var substring = Data[start..end];
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (1)
399return name.Substring(p.Start, p.Length).ToCamelCase();
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (13)
MSBuild\ProjectFile\ProjectInstanceReader.cs (1)
278return normalizedPath[projectDirectory.Length..];
src\roslyn\src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (9)
63s = s.Substring(0, lastSeparator); 181return path.Substring(0, i); 246return path.Substring(0, 1); 282return path.Substring(0, i); 289? path.Substring(0, 3) 290: path.Substring(0, 2); 313? path.Substring(0, 1) 506return path.Substring(0, path.Length - 1); 880var volumeSpecifier = isDriveRooted ? p.Substring(0, 2) : string.Empty;
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\CompilerOptionParseUtilities.cs (1)
61string name = feature.Substring(0, equals);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\FileNameUtilities.cs (2)
118return path.Substring(0, index); 124return path.Substring(0, path.Length - 1);
Microsoft.CSharp (1)
Microsoft\CSharp\RuntimeBinder\Syntax\NameTable.cs (1)
60return AddEntry(new Name(key.Substring(0, length)), hashCode);
Microsoft.Data.Analysis (2)
TextFieldParser.cs (2)
479return line.Substring(0, numberOfChars); 856field = line.Substring(index, delimiterMatch.Index - index);
Microsoft.Data.Analysis.Tests (2)
src\Microsoft.Data.Analysis\TextFieldParser.cs (2)
479return line.Substring(0, numberOfChars); 856field = line.Substring(index, delimiterMatch.Index - index);
Microsoft.Deployment.DotNet.Releases (4)
ReleaseVersion.cs (4)
708versionCore = input.Substring(0, prereleaseSeparatorIndex); 725versionCore = input.Substring(0, buildSeparatorIndex); 741prerelease = input.Substring(prereleaseSeparatorIndex + 1, buildSeparatorIndex - prereleaseSeparatorIndex - 1); 742versionCore = input.Substring(0, prereleaseSeparatorIndex);
Microsoft.Diagnostics.DataContractReader.Legacy (1)
ClrDataModule.cs (1)
167string methodName = fullName[Math.Min(dotPos + 1, fullName.Length - 1)..];
Microsoft.Diagnostics.NETCore.Client (2)
DiagnosticsIpc\ProcessEnvironment.cs (1)
59env[pair.Substring(0, equalsIdx)] = equalsIdx != pair.Length - 1 ? pair.Substring(equalsIdx + 1) : "";
IpcHelpers.cs (1)
20string value = Encoding.Unicode.GetString(buffer, index, size).Substring(0, length - 1);
Microsoft.DotNet.ApiCompat.Task (1)
src\sdk\src\Tasks\Common\Logger.cs (1)
93code = format.Substring(0, 10);
Microsoft.DotNet.Arcade.Sdk (5)
src\CalculateAssemblyAndFileVersions.cs (3)
86yy = int.Parse(BuildNumber.Substring(2, 2)); 87mm = int.Parse(BuildNumber.Substring(4, 2)); 88dd = int.Parse(BuildNumber.Substring(6, 2));
src\GenerateResxSource.cs (2)
128string docCommentString = value.Length > maxDocCommentLength ? value.Substring(0, maxDocCommentLength) + " ..." : value; 468namespaceName = fullName.Substring(0, lastDot);
Microsoft.DotNet.Build.Manifest (2)
MSBuildListSplitter.cs (1)
37var key = item.Substring(0, splitIdx).Trim();
VersionIdentifier.cs (1)
112nextSegment = assetPathSegment.Substring(currentIndex, nextDelimiterIndex - currentIndex);
Microsoft.DotNet.Build.Tasks.Installers (20)
src\ArWriter.cs (6)
27Write(Encoding.ASCII.GetBytes(entry.Name.PadRight(16, ' ').Substring(0, 16))); 28Write(Encoding.ASCII.GetBytes(entry.Timestamp.ToString().PadRight(12, ' ').Substring(0, 12))); 29Write(Encoding.ASCII.GetBytes(entry.OwnerID.ToString().PadRight(6, ' ').Substring(0, 6))); 30Write(Encoding.ASCII.GetBytes(entry.GroupID.ToString().PadRight(6, ' ').Substring(0, 6))); 31Write(Encoding.ASCII.GetBytes(Convert.ToString(entry.Mode, 8).PadRight(8, ' ').Substring(0, 8))); 35Write(Encoding.ASCII.GetBytes(length.ToString().PadRight(10, ' ').Substring(0, 10)));
src\CreateWixBuildWixpack.cs (14)
470var key = entry.Substring(0, idx); 576string pattern = source.Substring(startIdx, source.IndexOf(')', startIdx + 2) - startIdx + 1); 699var varName = path.Substring(startIdx + 2, endIdx - (startIdx + 2)); 704path = path.Substring(0, startIdx) + varValue + path.Substring(endIdx + 1); 722path = path.Substring(0, startIdx) + varValue + path.Substring(endIdx + 1); 787output.Append(input.Substring(pos, nextBlockStart - pos)); 800string ifCondition = input.Substring(nextBlockStart + 4, ifEnd - (nextBlockStart + 4)).Trim(); 831elseifCondition = input.Substring(elseifStart + 8, elseifEnd - (elseifStart + 8)).Trim(); 866selectedContent = input.Substring(start, end - start); 871selectedContent = input.Substring(start, end - start); 888string variableName = input.Substring(nextBlockStart + (blockType == "ifdef" ? 7 : 8), tagEnd - (nextBlockStart + (blockType == "ifdef" ? 7 : 8))).Trim(); 894string innerVar = variableName.Substring(6, variableName.Length - 7); 900string innerConst = variableName.Substring(2, variableName.Length - 3); 922string selectedContent = input.Substring(blockStart, blockEnd - blockStart);
Microsoft.DotNet.Build.Tasks.Packaging (7)
FrameworkUtilities.cs (1)
52versionString = versionString.Substring(0, dashIndex);
NuGetAssetResolver.cs (1)
113yield return contentItem.Path.Substring(0, dirLength);
NugetPropertyStringProvider.cs (2)
62var key = propertyString.Substring(0, indexOfEquals); 66var value = propertyString.Substring(valueStartIndex, valueLength);
PackageItem.cs (1)
59TargetDirectory = (dirLength > 0) ? TargetPath.Substring(0, dirLength) : String.Empty;
ValidateHarvestVersionIsLatestForRelease.cs (1)
115harvestVersion = harvestedFrom.Substring(startIndex, endIndex - startIndex);
ValidatePackage.cs (1)
504fxString = fxString.Substring(1, fxString.Length - 2);
Microsoft.DotNet.Build.Tasks.Templating (1)
MSBuildListSplitter.cs (1)
29string key = item.Substring(0, splitIdx).Trim();
Microsoft.DotNet.Build.Tasks.Workloads (1)
Utils.cs (1)
37return result.Substring(0, 32);
Microsoft.DotNet.Cli.CoreUtils (2)
DotnetVersionFile.cs (1)
44CommitSha = line.Substring(0, 10);
SdkPaths.cs (1)
91? path.Substring(0, path.Length - 1)
Microsoft.DotNet.Cli.Definitions (5)
Commands\Restore\RestoreCommandDefinition.cs (2)
93=> rid.Substring(0, rid.LastIndexOf("-", StringComparison.InvariantCulture)); 96=> rid.Substring(rid.LastIndexOf("-", StringComparison.InvariantCulture) + 1, rid.Length - rid.LastIndexOf("-", StringComparison.InvariantCulture) - 1);
Common\TargetPlatformOptions.cs (2)
129=> rid.Substring(0, rid.LastIndexOf("-", StringComparison.InvariantCulture)); 132=> rid.Substring(rid.LastIndexOf("-", StringComparison.InvariantCulture) + 1, rid.Length - rid.LastIndexOf("-", StringComparison.InvariantCulture) - 1);
Help\HelpBuilder.cs (1)
324yield return part.Substring(i, length);
Microsoft.DotNet.Cli.Telemetry (4)
Implementation\AzureMonitorConnectionString.cs (1)
46var key = part.Substring(0, separatorIndex).Trim();
Implementation\BreezeSchema.cs (1)
75=> value is not null && value.Length > maxLength ? value.Substring(0, maxLength) : value;
Implementation\TelemetryResourceContextFactory.cs (2)
102var normalized = separatorIndex >= 0 ? version.Substring(0, separatorIndex) : version; 103return normalized.Length > 20 ? normalized.Substring(0, 20) : normalized;
Microsoft.DotNet.Cli.Utils (7)
AnsiConsole.cs (2)
98var text = message.Substring(escapeScan, escapeIndex - escapeScan); 108if (int.TryParse(message.Substring(startIndex, endIndex - startIndex), out int value))
Extensions\TypeExtensions.cs (1)
23var genericTypeName = typeName.Substring(0, typeName.IndexOf('`'));
PathUtility.cs (1)
45path = path.Substring(0, path.Length - 1);
RuntimeEnvironment.cs (3)
170VersionId = version.Substring("omnios-r".Length, 2) // e.g. 15 177VersionId = version.Substring("joyent_".Length, 4) // e.g. 2020 213distroInfo.VersionId = distroInfo.VersionId?.Substring(0, lastVersionNumberSeparatorIndex);
Microsoft.DotNet.GenFacades (1)
SourceGenerator.cs (1)
124sb.Append(typeName.Substring(0, splitIndex));
Microsoft.DotNet.HotReload.Utils.Generator.Frontend (4)
Frontend.cs (4)
61builder.ProjectPath = fn[msbuildOptPrefix.Length..]; 77builder.ScriptPath = fn[scriptOptPrefix.Length..]; 79builder.OutputSummaryPath = fn[outputSummaryPrefix.Length..]; 81builder.EditAndContinueCapabilities.Add (fn[capabilitiesPrefix.Length..]);
Microsoft.DotNet.NuGetRepack.Tasks (1)
src\NuGetUtils.cs (1)
17dirName = (lastSeparator == -1) ? "" : (lastSeparator == 0) ? "/" : partName.Substring(0, lastSeparator);
Microsoft.DotNet.PackageValidation (1)
Filtering\TargetFrameworkFilter.cs (1)
44string excludedTargetFrameworkWithoutWildcard = excludedTargetFramework.Substring(0, excludedTargetFramework.Length - 1);
Microsoft.DotNet.SdkResolver (1)
VSSettings.cs (1)
138string key = line.Substring(0, indexOfEquals).Trim();
Microsoft.DotNet.SourceBuild.Tasks (1)
src\UsageReport\WriteUsageReports.cs (1)
207Repo = filename.Substring(
Microsoft.DotNet.TemplateLocator (9)
src\sdk\src\Resolvers\Microsoft.DotNet.MSBuildSdkResolver\FXVersion.cs (6)
20return next == -1 ? ids.Substring(idStart) : ids.Substring(idStart, next - idStart); 179if (!ValidIdentifier(ids.Substring(idStart, nextId - idStart), buildMeta)) 221if (!int.TryParse(fxVersionString.Substring(0, majorSeparator), out major)) 240if (!int.TryParse(fxVersionString.Substring(minorStart, minorSeparator - minorStart), out minor)) 272if (!int.TryParse(fxVersionString.Substring(patchStart, patchSeparator - patchStart), out patch)) 284string pre = (preSeparator == -1) ? fxVersionString.Substring(preStart) : fxVersionString.Substring(preStart, preSeparator - preStart);
src\sdk\src\Resolvers\Microsoft.NET.Sdk.WorkloadManifestReader\SdkDirectoryWorkloadManifestProvider.cs (2)
244var firstVersion = new Version(first.Substring(0, firstDash)); 245var secondVersion = new Version(second.Substring(0, secondDash));
src\sdk\src\Resolvers\Microsoft.NET.Sdk.WorkloadManifestReader\TempDirectoryWorkloadManifestProvider.cs (1)
29manifestId = manifestId.Substring(0, index);
Microsoft.DotNet.XliffTasks (3)
Model\UnstructuredDocument.cs (3)
31string plainSpan = text.Substring(lastSpanEnd, spanStart - lastSpanEnd); 43string translatableSpan = text.Substring(spanStart + TranslatableSpanMarker.Length, spanLength); 50string id = translatableSpan.Substring(0, separatorIndex);
Microsoft.Extensions.AI (1)
parent\parent\parent\eng\MSBuild\parent\parent\src\LegacySupport\MediaTypeMap\MediaTypeMap.cs (1)
773mediaType = mediaType.Substring(0, semicolonIndex).Trim();
Microsoft.Extensions.AI.Abstractions (4)
Contents\DataContent.cs (1)
388$"Data = {uri.Substring(0, MaxLength)}...";
Contents\UriContent.cs (1)
110path = path.Substring(0, i);
Functions\AIFunctionFactory.cs (1)
876string.Concat(name.Substring(0, asyncIndex), name.Substring(asyncIndex + AsyncSuffix.Length));
parent\parent\parent\eng\MSBuild\parent\parent\src\LegacySupport\MediaTypeMap\MediaTypeMap.cs (1)
773mediaType = mediaType.Substring(0, semicolonIndex).Trim();
Microsoft.Extensions.AI.Evaluation.Reporting (1)
Formats\Html\HtmlReportWriter.cs (1)
94HtmlTemplateBefore = all.Substring(0, start);
Microsoft.Extensions.AI.Evaluation.Reporting.Azure (1)
Storage\AzureStorageResultStore.cs (1)
185=> name.Substring(0, name.LastIndexOf('.'));
Microsoft.Extensions.AI.Integration.Tests (5)
PromptBasedFunctionCallingChatClient.cs (2)
104toolCall = toolCall.Substring(0, endPos); 117var id = Guid.NewGuid().ToString().Substring(0, 6);
VerbatimMultiPartHttpHandler.cs (3)
107string headers = part.Substring(0, headerEnd).Trim(); 195return headers.Substring(start, end - start).Trim('"'); 214return headers.Substring(start, end - start).Trim('"');
Microsoft.Extensions.AI.OpenAI (3)
OpenAIChatClient.cs (1)
854name = name.Substring(0, MaxLength);
parent\parent\parent\eng\MSBuild\parent\parent\src\LegacySupport\MediaTypeMap\MediaTypeMap.cs (1)
773mediaType = mediaType.Substring(0, semicolonIndex).Trim();
RequestOptionsExtensions.cs (1)
73version = version.Substring(0, pos);
Microsoft.Extensions.Configuration (1)
ConfigurationProvider.cs (1)
100return indexOf < 0 ? key.Substring(prefixLength) : key.Substring(prefixLength, indexOf - prefixLength);
Microsoft.Extensions.Configuration.Abstractions (1)
ConfigurationPath.cs (1)
74return lastDelimiterIndex < 0 ? null : path.Substring(0, lastDelimiterIndex);
Microsoft.Extensions.Configuration.Binder.SourceGeneration (1)
Specs\TypeIndex.cs (1)
98string proxyTypeNameStr = lastDotIndex >= 0 ? $"{typeFNQ.Substring(0, lastDotIndex + 1)}{genericProxyTypeName}" : genericProxyTypeName.ToString();
Microsoft.Extensions.Configuration.CommandLine (2)
CommandLineConfigurationProvider.cs (2)
106string keySegment = currentArg.Substring(0, separator); 121key = currentArg.Substring(keyStartIndex, separator - keyStartIndex);
Microsoft.Extensions.Configuration.Ini (2)
IniStreamConfigurationProvider.cs (2)
67string key = sectionPrefix + line.Substring(0, separator).Trim(); 73value = value.Substring(1, value.Length - 2);
Microsoft.Extensions.Configuration.KeyPerFile (1)
KeyPerFileConfigurationProvider.cs (1)
47? value.Substring(0, value.Length - Environment.NewLine.Length)
Microsoft.Extensions.DataIngestion.Abstractions (1)
parent\parent\parent\eng\MSBuild\parent\parent\src\LegacySupport\MediaTypeMap\MediaTypeMap.cs (1)
773mediaType = mediaType.Substring(0, semicolonIndex).Trim();
Microsoft.Extensions.DataIngestion.Markdig (2)
MarkdownParser.cs (2)
79string elementMarkdown = documentMarkdown.Substring(block.Span.Start, block.Span.Length); 173string childMarkdown = documentMarkdown.Substring(leafBlock.Span.Start, leafBlock.Span.Length);
Microsoft.Extensions.DataIngestion.MarkItDown (2)
parent\Microsoft.Extensions.DataIngestion.Markdig\MarkdownParser.cs (2)
79string elementMarkdown = documentMarkdown.Substring(block.Span.Start, block.Span.Length); 173string childMarkdown = documentMarkdown.Substring(leafBlock.Span.Start, leafBlock.Span.Length);
Microsoft.Extensions.DependencyInjection (2)
DependencyInjectionEventSource.cs (2)
126format.Substring(i * MaxChunkSize, Math.Min(MaxChunkSize, format.Length - i * MaxChunkSize)), i, chunkCount, 254descriptorString.Substring(i * MaxChunkSize, Math.Min(MaxChunkSize, descriptorString.Length - i * MaxChunkSize)), i, chunkCount);
Microsoft.Extensions.DependencyModel (4)
DependencyContextExtensions.cs (1)
120name = name.Substring(0, name.Length - NativeImageSufix.Length);
DependencyContextJsonReader.cs (2)
179framework = runtimeTargetName.Substring(0, separatorIndex); 781string name = Pool(nameWithVersion.Substring(0, separatorPosition));
RuntimeAssembly.cs (1)
42assemblyName = assemblyName.Substring(0, assemblyName.Length - NativeImageSufix.Length);
Microsoft.Extensions.FileProviders.Embedded (1)
EmbeddedFileProvider.cs (1)
102subpath = subpath.Substring(1, subpath.Length - 1);
Microsoft.Extensions.FileSystemGlobbing (2)
InMemoryDirectoryInfo.cs (1)
116string name = file.Substring(0, endSegment);
Internal\Patterns\PatternBuilder.cs (1)
214return pattern.Substring(beginIndex, endIndex - beginIndex);
Microsoft.Extensions.Http.Diagnostics.Tests (5)
Logging\AcceptanceTests.cs (1)
693var loggedBodyString = responseString.Substring(0, length);
Logging\HttpRequestBodyReaderTest.cs (2)
141requestBody.Should().BeEquivalentTo(input.Substring(0, limit)); 165requestBody.Should().BeEquivalentTo(input.Substring(0, limit / 2));
Logging\HttpResponseBodyReaderTest.cs (2)
161responseBody.Should().Be(bigContent.Substring(0, limit)); 300responseBody.Should().Be(content.Substring(0, options.BodySizeLimit));
Microsoft.Extensions.Identity.Core (1)
DefaultPersonalDataProtector.cs (1)
43var keyId = data.Substring(0, split);
Microsoft.Extensions.Logging.Abstractions (1)
LogValuesFormatter.cs (1)
70_valueNames.Add(format.Substring(openBraceIndex + 1, formatDelimiterIndex - openBraceIndex - 1));
Microsoft.Extensions.Logging.EventSource (1)
LoggingEventSource.cs (1)
463loggerName = loggerName.Substring(0, loggerName.Length - 1);
Microsoft.Extensions.Logging.Generators (1)
LoggerMessageGenerator.Parser.cs (1)
871string templateName = message.Substring(openBraceIndex + 1, formatDelimiterIndex - openBraceIndex - 1);
Microsoft.Extensions.Logging.TraceSource (1)
TraceSourceLoggerProvider.cs (1)
99return indexOfLastDot == -1 ? null : traceSourceName.Substring(0, indexOfLastDot);
Microsoft.Extensions.Primitives (2)
StringSegment.cs (2)
82public string? Value => HasValue ? Buffer.Substring(Offset, Length) : null; 399return Buffer.Substring(Offset + offset, length);
Microsoft.Extensions.ServiceDiscovery.Dns.Tests (1)
XunitLoggerFactoryExtensions.cs (1)
116message = message.Substring(0, message.Length - Environment.NewLine.Length);
Microsoft.Extensions.Telemetry (2)
Http\HttpRouteParser.cs (2)
130httpRoute = httpRoute.Substring(0, pos); 242return httpRoute.Substring(start, end - start);
Microsoft.Extensions.Validation.ValidationsGenerator (2)
src\aspnetcore\src\Shared\RoslynUtils\WellKnownTypes.cs (2)
43name = name.Substring(0, separator); 44typeIdName = typeIdName.Substring(0, separator);
Microsoft.Extensions.VectorData.Abstractions (1)
ProviderServices\VectorDataStrings.cs (1)
83var genericTypeName = type.Name.Substring(0, i);
Microsoft.Gen.BuildMetadata (1)
GeneratorUtilities.cs (1)
59_ = shortAttributeNames.Add(n.Substring(index, n.Length - index - "Attribute".Length));
Microsoft.Gen.ComplianceReports (2)
GeneratorUtilities.cs (1)
59_ = shortAttributeNames.Add(n.Substring(index, n.Length - index - "Attribute".Length));
Parser.cs (1)
260name = name.Substring(0, name.Length - "Attribute".Length);
Microsoft.Gen.ContextualOptions (1)
GeneratorUtilities.cs (1)
59_ = shortAttributeNames.Add(n.Substring(index, n.Length - index - "Attribute".Length));
Microsoft.Gen.Logging (3)
GeneratorUtilities.cs (1)
59_ = shortAttributeNames.Add(n.Substring(index, n.Length - index - "Attribute".Length));
TemplateProcessor.cs (2)
58var templateName = message.Substring(openBraceIndex + 1, formatDelimiterIndex - openBraceIndex - 1).Trim(); 114var templateName = message.Substring(openBraceIndex + 1, formatDelimiterIndex - openBraceIndex - 1).Trim();
Microsoft.Gen.MetadataExtractor (2)
GeneratorUtilities.cs (1)
59_ = shortAttributeNames.Add(n.Substring(index, n.Length - index - "Attribute".Length));
Parser.cs (1)
260name = name.Substring(0, name.Length - "Attribute".Length);
Microsoft.Gen.Metrics (1)
GeneratorUtilities.cs (1)
59_ = shortAttributeNames.Add(n.Substring(index, n.Length - index - "Attribute".Length));
Microsoft.Gen.MetricsReports (1)
GeneratorUtilities.cs (1)
59_ = shortAttributeNames.Add(n.Substring(index, n.Length - index - "Attribute".Length));
Microsoft.Interop.ComInterfaceGenerator (1)
src\runtime\src\libraries\System.Runtime.InteropServices\gen\Common\ConvertToSourceGeneratedInteropFixer.cs (1)
71string type = optionKeyAndValue[1].Substring(0, 2);
Microsoft.Interop.JavaScript.JSImportGenerator (1)
JSMarshalAsAttributeInfoParser.cs (1)
31name = name.Substring(0, name.IndexOf('<'));
Microsoft.Interop.LibraryImportGenerator (2)
Analyzers\ConvertToLibraryImportFixer.cs (1)
666preferCollectionExpressionsRule = preferCollectionExpressionsRule.Substring(0, indexOfColon);
src\runtime\src\libraries\System.Runtime.InteropServices\gen\Common\ConvertToSourceGeneratedInteropFixer.cs (1)
71string type = optionKeyAndValue[1].Substring(0, 2);
Microsoft.Maui (9)
Core\Extensions\ITextInputExtensions.cs (1)
19 platformText = platformText.Substring(0, maxLength);
Fonts\FontFile.cs (4)
76 var fontFamilyName = hashIndex > 0 ? input.Substring(0, hashIndex) : input; 84 fontFamilyName = fontFamilyName.Substring(0, fontFamilyName.Length - foundExtension.Length); 112 var cleansedString = index > 0 ? fontFamily.Substring(0, index) : fontFamily; 145 yield return currentString.Substring(0, currentString.Length - 1);
Handlers\HybridWebView\HybridWebViewHandler.cs (2)
118 var messageType = rawMessage.Substring(0, indexOfPipe); 136 var taskId = messageContent.Substring(0, indexOfPipeInContent);
Handlers\HybridWebView\HybridWebViewQueryStringHelper.cs (1)
19 : url.Substring(0, indexOfQueryString);
StringExtensions.cs (1)
8 ? currentText.Substring(0, maxLength)
Microsoft.Maui.Controls (9)
BindingExpression.cs (2)
246 string argString = part.Substring(lbIndex + 1, argLength); 249 part = part.Substring(0, lbIndex);
Brush\BrushTypeConverter.cs (1)
378 var number = part.Substring(0, index);
GridLengthTypeConverter.cs (1)
30 if (strValue.EndsWith("*", StringComparison.Ordinal) && double.TryParse(strValue.Substring(0, strValue.Length - 1), NumberStyles.Number, CultureInfo.InvariantCulture, out var length))
Shapes\PathFigureCollectionConverter.cs (1)
558 string subString = currentPathString.Substring(start, currentIndex - start);
VisualElement\VisualElement.cs (2)
228 var transformName = transform.Substring(0, openBracket); 229 var value = transform.Substring(openBracket + 1, closeBracket - openBracket - 1);
Visuals\VisualTypeConverter.cs (2)
127 name = name.Substring(0, name.Length - 6); 128 fullName = fullName.Substring(0, fullName.Length - 6);
Microsoft.Maui.Controls.Build.Tasks (11)
BindablePropertyReferenceExtensions.cs (2)
16 var bpName = bpRef.Name.Substring(0, bpRef.Name.Length - 8); 36 var bpName = bpRef.Name.EndsWith("Property", StringComparison.Ordinal) ? bpRef.Name.Substring(0, bpRef.Name.Length - 8) : bpRef.Name;
CompiledConverters\FlexBasisTypeConverter.cs (1)
28 && float.TryParse(value.Substring(0, value.Length - 1), NumberStyles.Number, CultureInfo.InvariantCulture, out float relflex))
CompiledConverters\GridLengthTypeConverter.cs (1)
32 if (value.EndsWith("*", StringComparison.OrdinalIgnoreCase) && double.TryParse(value.Substring(0, value.Length - 1), NumberStyles.Number, CultureInfo.InvariantCulture, out var length))
CompiledMarkupExtensions\StaticExtension.cs (1)
24 var typename = member.Substring(0, dotIdx);
SetPropertiesVisitor.cs (4)
577 var prefix = dataType.Contains(":") ? dataType.Substring(0, dataType.IndexOf(":", StringComparison.Ordinal)) : ""; 699 indexArg = p.Substring(lbIndex + 1, argLength).Trim(); 703 p = p.Substring(0, lbIndex); 1808 var typename = localname.Substring(0, dotIdx);
TypeReferenceExtensions.cs (2)
29 var xname = x.FullName.EndsWith("&", StringComparison.InvariantCulture) ? x.FullName.Substring(0, x.FullName.Length - 1) : x.FullName; 30 var yname = y.FullName.EndsWith("&", StringComparison.InvariantCulture) ? y.FullName.Substring(0, y.FullName.Length - 1) : y.FullName;
Microsoft.Maui.Controls.DesignTools (2)
FlexEnumDesignTypeConverters.cs (1)
115 if (strValue.EndsWith("%", StringComparison.OrdinalIgnoreCase) && float.TryParse(strValue.Substring(0, strValue.Length - 1), NumberStyles.Number, CultureInfo.InvariantCulture, out float relflex))
GridLengthDesignTypeConverter.cs (1)
29 if (value.EndsWith("*", StringComparison.Ordinal) && double.TryParse(value.Substring(0, value.Length - 1), NumberStyles.Number, CultureInfo.InvariantCulture, out var len))
Microsoft.Maui.Controls.SourceGen (10)
CodeBehindGenerator.cs (1)
571 fullName = fullName.Substring(0, i);
src\Controls\src\Xaml\TypeArgumentsParser.cs (3)
55 var type = match.Substring(0, pos).Trim(); 62 type.Substring(openBracket + 1, type.LastIndexOf(")", StringComparison.Ordinal) - openBracket - 1), resolver, lineinfo); 63 type = type.Substring(0, openBracket);
src\Controls\src\Xaml\XmlnsHelper.cs (6)
42 ns = decl.Substring(14, decl.Length - 14); 47 asm = decl.Substring(9, decl.Length - 9); 52 targetPlatform = decl.Substring(15, decl.Length - 15); 58 ns = decl.Substring(0, nsind); 59 typeName = decl.Substring(nsind + 1, decl.Length - nsind - 1); 74 ns = decl.Substring(6, decl.Length - 6);
Microsoft.Maui.Controls.Xaml (12)
ApplyPropertiesVisitor.cs (1)
305 var typename = localname.Substring(0, dotIdx);
MarkupExpressionParser.cs (1)
121 match = expression.Substring(i, c);
MarkupExtensions\StaticExtension.cs (1)
27 var typename = Member.Substring(0, dotIdx);
TypeArgumentsParser.cs (3)
55 var type = match.Substring(0, pos).Trim(); 62 type.Substring(openBracket + 1, type.LastIndexOf(")", StringComparison.Ordinal) - openBracket - 1), resolver, lineinfo); 63 type = type.Substring(0, openBracket);
XmlnsHelper.cs (6)
42 ns = decl.Substring(14, decl.Length - 14); 47 asm = decl.Substring(9, decl.Length - 9); 52 targetPlatform = decl.Substring(15, decl.Length - 15); 58 ns = decl.Substring(0, nsind); 59 typeName = decl.Substring(nsind + 1, decl.Length - nsind - 1); 74 ns = decl.Substring(6, decl.Length - 6);
Microsoft.Maui.Essentials (3)
TextToSpeech\TextToSpeech.shared.cs (3)
96 p = text.Substring(positionbegin, text.Length - positionbegin); 104 p = text.Substring(positionbegin, positionend - positionbegin); 111 p = text.Substring(positionbegin, positionbegin + max);
Microsoft.Maui.Graphics (16)
Text\AttributedTextExtensions.cs (2)
171 var noAttrValue = text.Text.Substring(start, noAttrLength); 179 var value = text.Text.Substring(start, length);
Text\TextColors.cs (14)
173 red = int.Parse(color.Substring(1, 2), NumberStyles.AllowHexSpecifier, CultureInfo.InvariantCulture); 174 green = int.Parse(color.Substring(3, 2), NumberStyles.AllowHexSpecifier, CultureInfo.InvariantCulture); 175 blue = int.Parse(color.Substring(5, 2), NumberStyles.AllowHexSpecifier, CultureInfo.InvariantCulture); 187 red = int.Parse(color.Substring(1, 2), NumberStyles.AllowHexSpecifier, CultureInfo.InvariantCulture); 188 green = int.Parse(color.Substring(3, 2), NumberStyles.AllowHexSpecifier, CultureInfo.InvariantCulture); 189 blue = int.Parse(color.Substring(5, 2), NumberStyles.AllowHexSpecifier, CultureInfo.InvariantCulture); 190 alpha = int.Parse(color.Substring(7, 2), NumberStyles.AllowHexSpecifier, CultureInfo.InvariantCulture); 216 red = int.Parse(color.Substring(1, 2), NumberStyles.AllowHexSpecifier, CultureInfo.InvariantCulture); 217 green = int.Parse(color.Substring(3, 2), NumberStyles.AllowHexSpecifier, CultureInfo.InvariantCulture); 218 blue = int.Parse(color.Substring(5, 2), NumberStyles.AllowHexSpecifier, CultureInfo.InvariantCulture); 230 red = int.Parse(color.Substring(1, 2), NumberStyles.AllowHexSpecifier, CultureInfo.InvariantCulture); 231 green = int.Parse(color.Substring(3, 2), NumberStyles.AllowHexSpecifier, CultureInfo.InvariantCulture); 232 blue = int.Parse(color.Substring(5, 2), NumberStyles.AllowHexSpecifier, CultureInfo.InvariantCulture); 233 alpha = int.Parse(color.Substring(7, 2), NumberStyles.AllowHexSpecifier, CultureInfo.InvariantCulture);
Microsoft.Maui.Graphics.Text.Markdig (2)
Renderer\HtmlInlineRenderer.cs (1)
28 var style = tag.Substring(firstQuote, secondQuote - firstQuote);
Renderer\SimpleCssParser.cs (1)
23 var key = entry.Substring(0, index).Trim();
Microsoft.ML.AutoML (1)
Utils\SweepableParamAttributes.cs (1)
100var index2 = name.Substring(0, index1).LastIndexOf(".", StringComparison.Ordinal) + 1;
Microsoft.ML.CodeGenerator (1)
Utils.cs (1)
135if (!string.IsNullOrEmpty(input) && int.TryParse(input.Substring(0, 1), out int val))
Microsoft.ML.Core (11)
CommandLine\CmdParser.cs (8)
450return name.Substring(0, 1).ToLowerInvariant() + name.Substring(1); 459return name.Substring(0, firstNonUpper).ToLowerInvariant() + name.Substring(firstNonUpper); 714option = str.Substring(0, ichLim); 719option = str.Substring(0, ichLim); 736tag = option.Substring(open, close - open + 1); 737option = option.Substring(0, open); 1168kind = str.Substring(0, ich); 1685tag = hasTag ? tag.Substring(1, tag.Length - 2) : "";
EntryPoints\ModuleArgs.cs (1)
380var index2 = name.Substring(0, index1).LastIndexOf(".", StringComparison.Ordinal) + 1;
Environment\HostEnvironmentBase.cs (2)
557writer.WriteLine(message.Substring(ichMin, ichLim - ichMin)); 569writer.WriteLine(message.Substring(ichMin, ichLim - ichMin));
Microsoft.ML.Data (17)
DataLoadSave\Text\TextLoader.cs (1)
382else if (!int.TryParse(str.Substring(0, ich), out Min))
Evaluators\EvaluatorUtils.cs (1)
1723return str.Substring(0, totalLength - 1).PadRight(totalLength, '.');
Model\Pfa\ModelUtils.cs (2)
22return name.Substring(0, 1).ToLowerInvariant() + name.Substring(1); 31return name.Substring(0, firstNonUpper).ToLowerInvariant() + name.Substring(firstNonUpper);
Transforms\ColumnBindingsBase.cs (6)
146Name = str.Substring(0, ich); 177Name = str.Substring(0, ich); 188extra = str.Substring(ichMin, ich - ichMin); 810name = str.Substring(0, ich); 843name = str.Substring(0, ich); 860extra = str.Substring(ichMin, ich - ichMin);
Transforms\GenerateNumberTransform.cs (1)
69Name = str.Substring(0, ich);
Transforms\SlotsDroppingTransformer.cs (2)
72if (!base.TryParse(str.Substring(0, ich))) 156if (!int.TryParse(str.Substring(0, ich), out Min))
Utilities\StreamUtils.cs (1)
84var left = currentPattern.Substring(0, recursiveIndex);
Utilities\TypeParsingUtils.cs (3)
38keyCount = KeyCount.Parse(str.Substring(ich + 1, str.Length - ich - 2)); 43str = str.Substring(0, ich); 125if (!ulong.TryParse(str.Substring(0, ich), out min))
Microsoft.ML.EntryPoints (1)
JsonUtils\ExecuteGraphCommand.cs (1)
168string partialPath = path.Substring(0, path.Length - extension.Length);
Microsoft.ML.GenAI.Core (1)
Trainer\CausalLMDataset.cs (1)
42outputPrompt = outputPrompt.Substring(inputPrompt.Length, lengthToKeep);
Microsoft.ML.GenAI.Mistral (1)
MistralCausalLMAgent.cs (1)
104if (!str.StartsWith("[TOOL_CALLS]".Substring(0, str.Length)))
Microsoft.ML.IntegrationTests (1)
IntrospectiveTraining.cs (1)
360slotNameString = slotNameString.Substring(1, slotNameString.Length - 2);
Microsoft.ML.LightGbm (1)
WrappedLightGbmBooster.cs (1)
216var param = lines[i].Substring(1, lines[i].Length - 2).Split(':');
Microsoft.ML.PerformanceTests (1)
ImageClassificationBench.cs (1)
121label = label.Substring(0, index);
Microsoft.ML.Predictor.Tests (3)
CmdLine\CmdIndenterTest.cs (1)
81string input = text.Substring(ichMin, ichLim - ichMin);
CmdLine\CmdLine.cs (1)
383string input = text.Substring(ichMin, ichLim - ichMin);
CompareBaselines.cs (1)
331string str = line.Substring(ich, ichLim - ich);
Microsoft.ML.ResultProcessor (1)
ResultProcessor.cs (1)
994nameValCols[1] = nameValCols[1].Substring(0, nameValCols[1].Length - 1);
Microsoft.ML.Samples (7)
Dynamic\Trainers\MulticlassClassification\ImageClassification\ImageClassificationDefault.cs (2)
188label = label.Substring(0, index); 224label = label.Substring(0, index);
Dynamic\Trainers\MulticlassClassification\ImageClassification\LearningRateSchedulingCifarResnetTransferLearning.cs (2)
216label = label.Substring(0, index); 254label = label.Substring(0, index);
Dynamic\Trainers\MulticlassClassification\ImageClassification\ResnetV2101TransferLearningEarlyStopping.cs (1)
212label = label.Substring(0, index);
Dynamic\Trainers\MulticlassClassification\ImageClassification\ResnetV2101TransferLearningTrainTestSplit.cs (2)
197label = label.Substring(0, index); 233label = label.Substring(0, index);
Microsoft.ML.Samples.GPU (7)
docs\e4e90a0f3c9b109a\LearningRateSchedulingCifarResnetTransferLearning.cs (2)
216label = label.Substring(0, index); 254label = label.Substring(0, index);
docs\samples\Microsoft.ML.Samples\Dynamic\Trainers\MulticlassClassification\ImageClassification\ImageClassificationDefault.cs (2)
188label = label.Substring(0, index); 224label = label.Substring(0, index);
docs\samples\Microsoft.ML.Samples\Dynamic\Trainers\MulticlassClassification\ImageClassification\ResnetV2101TransferLearningEarlyStopping.cs (1)
212label = label.Substring(0, index);
docs\samples\Microsoft.ML.Samples\Dynamic\Trainers\MulticlassClassification\ImageClassification\ResnetV2101TransferLearningTrainTestSplit.cs (2)
197label = label.Substring(0, index); 233label = label.Substring(0, index);
Microsoft.ML.Sweeper (1)
Parameters.cs (1)
548paramValue = paramValue.Substring(0, atIdx);
Microsoft.ML.TensorFlow (2)
TensorflowTransform.cs (1)
324var op = operation.Substring(0, p);
TensorflowUtils.cs (1)
574var op = operation.Substring(0, p);
Microsoft.ML.TensorFlow.Tests (1)
TensorflowTests.cs (1)
1920label = label.Substring(0, index);
Microsoft.ML.TestFramework (1)
SubComponent.cs (1)
180kind = str.Substring(0, ich);
Microsoft.ML.TestFrameworkCommon (2)
TestLogger.cs (2)
33value = value.Substring(0, value.Length - 2); 40format = format.Substring(0, format.Length - 2);
Microsoft.ML.Tests (2)
ExpressionLanguageTests\ExpressionLanguageTests.cs (1)
228string[] toks = text.Substring(ichMin, ichCol - ichMin).Split(',');
OnnxSequenceTypeWithAttributesTest.cs (1)
110Assert.Equal(expectedExceptionMessage, ex.Message.Substring(0, 387));
Microsoft.ML.Tokenizers (5)
Model\BPETokenizer.cs (2)
182merges.Push((merge.Substring(0, index), merge.Substring(index + 1))); 1169merges.Push((line.Substring(0, index), line.Substring(index + 1)));
Model\CodeGenTokenizer.cs (1)
1790mergeRanks.Add(new StringSpanOrdinalKeyPair(line.Substring(0, index), line.Substring(index + 1)), rank++);
Model\EnglishRobertaTokenizer.cs (1)
222mergeRanks.Set((line.Substring(0, index), line.Substring(index + 1)), rank++);
Utils\Helpers.netcoreapp.cs (1)
40throw new FormatException($"Invalid base64 string '{base64String.Substring(offset, length)}'");
Microsoft.ML.Tokenizers.Tests (9)
src\Microsoft.ML.Tokenizers\Utils\Helpers.netcoreapp.cs (1)
40throw new FormatException($"Invalid base64 string '{base64String.Substring(offset, length)}'");
TiktokenTests.cs (1)
924string inputMixed = string.Join(" ", Enumerable.Repeat("Hello World! Test123", length / 20 + 1)).Substring(0, length);
TokenizerTests.cs (2)
153string prefixString = (processedText1 ?? input).Substring(0, index1); 208Assert.Equal(0, tokenizer.CountTokens(s.Substring(0, index2)));
UnigramTests.cs (4)
499IReadOnlyList<int> ids1 = _unigramTokenizer.EncodeToIds(normalized!.Substring(0, index), addBeginningOfSentence: false, addEndOfSentence: false, considerNormalization: false); 505ids1 = _unigramTokenizer.EncodeToIds(normalized!.Substring(0, index).AsSpan(), addBeginningOfSentence: false, addEndOfSentence: false, considerNormalization: false); 511ids1 = _unigramTokenizer.EncodeToIds(normalized!.Substring(0, index), addBeginningOfSentence: false, addEndOfSentence: false, considerNormalization: false); 517ids1 = _unigramTokenizer.EncodeToIds(normalized!.Substring(0, index).AsSpan(), addBeginningOfSentence: false, addEndOfSentence: false, considerNormalization: false);
WordPieceTests.cs (1)
114Assert.Equal(j == 0 ? "" : text.Substring(0, tokens[j - 1].Offset.End.Value), bufferSlice.Slice(0, charsWritten).ToString());
Microsoft.ML.Transforms (1)
Expression\KeyWordTable.cs (1)
69NormStr nstrTmp = _pool.Add(str.Substring(0, cch));
Microsoft.ML.Vision (1)
DnnRetrainTransform.cs (1)
566var op = operation.Substring(0, p);
Microsoft.NET.Build.Extensions.Tasks (2)
src\sdk\src\Tasks\Common\ConflictResolution\PackageOverride.cs (1)
67string overriddenPackage = trimmedOverriddenPackagesAndVersion.Substring(0, separatorIndex);
src\sdk\src\Tasks\Common\Logger.cs (1)
93code = format.Substring(0, 10);
Microsoft.NET.Build.Tasks (17)
GenerateDepsFile.cs (1)
314: runtimeIdentifier.Substring(0, separator);
GenerateRuntimeConfigurationFiles.cs (1)
402path = path.Substring(0, path.Length - 1);
LockFileExtensions.cs (1)
123return dependency.Substring(0, indexOfWhiteSpace);
ProcessFrameworkReferences.cs (1)
600string platform = separator < 0 ? runtimeIdentifier : runtimeIdentifier.Substring(0, separator);
ProjectContext.cs (1)
203projectFileDependency.Substring(0, separatorIndex) :
ResolveReadyToRunCompilers.cs (1)
308platform = runtimeIdentifier.Substring(0, separator).ToLowerInvariant();
src\sdk\src\Resolvers\Microsoft.DotNet.MSBuildSdkResolver\FXVersion.cs (6)
20return next == -1 ? ids.Substring(idStart) : ids.Substring(idStart, next - idStart); 179if (!ValidIdentifier(ids.Substring(idStart, nextId - idStart), buildMeta)) 221if (!int.TryParse(fxVersionString.Substring(0, majorSeparator), out major)) 240if (!int.TryParse(fxVersionString.Substring(minorStart, minorSeparator - minorStart), out minor)) 272if (!int.TryParse(fxVersionString.Substring(patchStart, patchSeparator - patchStart), out patch)) 284string pre = (preSeparator == -1) ? fxVersionString.Substring(preStart) : fxVersionString.Substring(preStart, preSeparator - preStart);
src\sdk\src\Resolvers\Microsoft.NET.Sdk.WorkloadManifestReader\SdkDirectoryWorkloadManifestProvider.cs (2)
244var firstVersion = new Version(first.Substring(0, firstDash)); 245var secondVersion = new Version(second.Substring(0, secondDash));
src\sdk\src\Resolvers\Microsoft.NET.Sdk.WorkloadManifestReader\TempDirectoryWorkloadManifestProvider.cs (1)
29manifestId = manifestId.Substring(0, index);
src\sdk\src\Tasks\Common\ConflictResolution\PackageOverride.cs (1)
67string overriddenPackage = trimmedOverriddenPackagesAndVersion.Substring(0, separatorIndex);
src\sdk\src\Tasks\Common\Logger.cs (1)
93code = format.Substring(0, 10);
Microsoft.NET.HostModel (1)
Bundle\Manifest.cs (1)
142string id = Base64Url.EncodeToString(manifestHash).Substring(0, BundleIdLength);
Microsoft.NET.Sdk.BlazorWebAssembly.Tasks (3)
GenerateServiceWorkerAssetsManifest.cs (1)
73version = Convert.ToBase64String(bytes).Substring(0, 8);
src\sdk\src\StaticWebAssetsSdk\Tasks\Data\StaticWebAsset.cs (1)
485var reqName = requirement.Substring(0, eqIdx);
UpgradeLegacyWasmStaticWebAssets.cs (1)
36var relatedPath = legacyAsset.RelativePath.Substring(0, legacyAsset.RelativePath.Length - 3);
Microsoft.NET.Sdk.Publish.Tasks (2)
MsDeploy\CommonUtility.cs (2)
1500string subError = errorMessage.Substring(0, lastIndexOfFwLink); 1729str = str.Substring(0, str.Length - 1);
Microsoft.NET.Sdk.Razor.Tasks (1)
src\sdk\src\RazorSdk\Tool\PipeName.cs (1)
53.Substring(0, 25) // We only have ~50 total characters on Mac, so strip that down
Microsoft.NET.Sdk.StaticWebAssets.Tasks (4)
Compression\DiscoverPrecompressedAssets.cs (1)
83var identityWithoutExtension = candidate.Identity.Substring(0, candidate.Identity.Length - 3); // We take advantage we know the extension is .br or .gz.
Data\StaticWebAsset.cs (1)
485var reqName = requirement.Substring(0, eqIdx);
GenerateStaticWebAssetEndpointsManifest.cs (1)
189return $"{header.Substring(0, index)}{encoded}{header.Substring(endIndex)}";
GenerateStaticWebAssetsDevelopmentManifest.cs (1)
324return StaticWebAsset.Normalize(asset.Identity[asset.ContentRoot.Length..]);
Microsoft.NET.Sdk.WorkloadManifestReader (9)
SdkDirectoryWorkloadManifestProvider.cs (2)
244var firstVersion = new Version(first.Substring(0, firstDash)); 245var secondVersion = new Version(second.Substring(0, secondDash));
src\sdk\src\Resolvers\Microsoft.DotNet.MSBuildSdkResolver\FXVersion.cs (6)
20return next == -1 ? ids.Substring(idStart) : ids.Substring(idStart, next - idStart); 179if (!ValidIdentifier(ids.Substring(idStart, nextId - idStart), buildMeta)) 221if (!int.TryParse(fxVersionString.Substring(0, majorSeparator), out major)) 240if (!int.TryParse(fxVersionString.Substring(minorStart, minorSeparator - minorStart), out minor)) 272if (!int.TryParse(fxVersionString.Substring(patchStart, patchSeparator - patchStart), out patch)) 284string pre = (preSeparator == -1) ? fxVersionString.Substring(preStart) : fxVersionString.Substring(preStart, preSeparator - preStart);
TempDirectoryWorkloadManifestProvider.cs (1)
29manifestId = manifestId.Substring(0, index);
Microsoft.SourceLink.AzureDevOpsServer.Git (1)
src\sourcelink\src\Common\Utilities\UriUtilities.cs (1)
65parts = relativeUrl.Substring(start, end - start + 1).Split(new[] { '/' });
Microsoft.SourceLink.AzureRepos.Git (2)
src\sourcelink\src\Common\Utilities\UriUtilities.cs (1)
65parts = relativeUrl.Substring(start, end - start + 1).Split(new[] { '/' });
TranslateRepositoryUrls.cs (1)
37var result = host[prefix.Length..];
Microsoft.SourceLink.Bitbucket.Git (1)
src\sourcelink\src\Common\Utilities\UriUtilities.cs (1)
65parts = relativeUrl.Substring(start, end - start + 1).Split(new[] { '/' });
Microsoft.SourceLink.Common (1)
src\sourcelink\src\Common\Utilities\UriUtilities.cs (1)
65parts = relativeUrl.Substring(start, end - start + 1).Split(new[] { '/' });
Microsoft.SourceLink.Gitea (1)
src\sourcelink\src\Common\Utilities\UriUtilities.cs (1)
65parts = relativeUrl.Substring(start, end - start + 1).Split(new[] { '/' });
Microsoft.SourceLink.Gitee (1)
src\sourcelink\src\Common\Utilities\UriUtilities.cs (1)
65parts = relativeUrl.Substring(start, end - start + 1).Split(new[] { '/' });
Microsoft.SourceLink.GitHub (1)
src\sourcelink\src\Common\Utilities\UriUtilities.cs (1)
65parts = relativeUrl.Substring(start, end - start + 1).Split(new[] { '/' });
Microsoft.SourceLink.GitLab (1)
src\sourcelink\src\Common\Utilities\UriUtilities.cs (1)
65parts = relativeUrl.Substring(start, end - start + 1).Split(new[] { '/' });
Microsoft.SourceLink.GitWeb (1)
src\sourcelink\src\Common\Utilities\UriUtilities.cs (1)
65parts = relativeUrl.Substring(start, end - start + 1).Split(new[] { '/' });
Microsoft.SourceLink.Tools.Package (2)
SourceLinkMap.cs (2)
147key = key.Substring(0, filePathStar); 163uriPrefix = value.Substring(0, uriStar);
Microsoft.TemplateEngine.Cli (12)
CliTemplateParameter.cs (1)
447if (!string.Equals(value.Substring(0, 2), "0x", StringComparison.OrdinalIgnoreCase))
Commands\AliasAssignmentCoordinator.cs (2)
171buckets[i] = parts[i].Substring(0, 1); 185buckets[i] = parts[i].Substring(0, buckets[i].Length + 1);
TabularOutput\TabularOutput.cs (8)
393if (text.Substring(position, newlineIndex - position).GetUnicodeLength() <= maxWidth) 395lines.Add(text.Substring(position, newlineIndex - position).TrimEnd()); 434if (text.Substring(position, text.Length - position).GetUnicodeLength() < maxLength) 442while (lastBreak > 0 && text.Substring(position, lastBreak - position).GetUnicodeLength() > maxLength) 450lines.Add(text.Substring(position, lastBreak - position + 1).TrimEnd()); 456lines.Add(text.Substring(position, properMax) + '-'); 474while (text.Substring(0, possibleLength).GetUnicodeLength() <= desiredLength) 478return text.Substring(0, possibleLength - 1) + _shrinkReplacement;
TemplateSearch\CliTemplateSearchCoordinator.cs (1)
220? $"{packageName} / {packageOwners.Substring(0, maxPackageOwnerLength)}"
Microsoft.TemplateEngine.Core (3)
Expressions\Cpp\CppStyleEvaluatorDefinition.cs (1)
572return literal.Substring(1, literal.Length - 2);
Expressions\Shared\XmlStyleConverters.cs (2)
34string hex = arg.Substring(i + 1, 4); 41string dec = arg.Substring(i, 4);
Microsoft.TemplateEngine.Edge (2)
Mount\FileSystemInfoBase.cs (1)
54string parentPath = FullPath.Substring(0, lastSlash + 1);
Settings\SettingsFilePaths.cs (1)
60string parentDir = localPath.Substring(0, parentDirEndIndex);
Microsoft.TemplateEngine.Orchestrator.RunnableProjects (3)
BindSymbolEvaluator.cs (1)
152prefix = configuredBinding.Substring(0, configuredBinding.IndexOf(':')).Trim();
DirectoryBasedTemplate.cs (1)
138string localeStr = filename.Substring(LocalizationFilePrefix.Length, filename.Length - LocalizationFilePrefix.Length - LocalizationFileExtension.Length);
OperationConfig\ConditionalBlockCommentConfig.cs (1)
60pseudoEndComment = endToken.Substring(0, endToken.Length - 1) + " " + endToken.Substring(endToken.Length - 1);
Microsoft.TemplateEngine.Utils (2)
InstallRequestPathResolution.cs (1)
58baseDir = baseDir.Substring(0, baseDir.Length - 1);
RangeVersionSpecification.cs (1)
57string endVersion = parts[1].Substring(0, parts[1].Length - 1);
Microsoft.TestPlatform.AdapterUtilities (11)
Helpers\ReflectionHelpers.cs (1)
63var code = escapedStringSegment.Substring(i + 2, 4);
ManagedNameUtilities\ManagedNameHelper.Reflection.cs (8)
217hierarchyValues[HierarchyConstants.Levels.TestGroupIndex] = managedMethodName.Substring(0, methodNameEndIndex); 220hierarchyValues[HierarchyConstants.Levels.ClassIndex] = managedTypeName.Substring(0, hierarchyPos[2]); 225hierarchyValues[HierarchyConstants.Levels.ClassIndex] = managedTypeName.Substring(hierarchyPos[1] + 1, hierarchyPos[2] - hierarchyPos[1] - 1); 226hierarchyValues[HierarchyConstants.Levels.NamespaceIndex] = managedTypeName.Substring(hierarchyPos[0], hierarchyPos[1] - hierarchyPos[0]); 414var part = namespaceString.Substring(start, i - start); 440var arityString = name.Substring(arityStart, name.Length - arityStart); 445name = name.Substring(0, arityStart - 1); 518typeName = typeName.Substring(0, i + 1);
ManagedNameUtilities\ManagedNameParser.cs (2)
38namespaceName = managedTypeName.Substring(0, pos); 79=> managedMethodName.Substring(start, end - start);
Microsoft.TestPlatform.CommunicationUtilities (1)
JsonDataSerializer.cs (1)
177substring = rawMessage.Substring(start, i - start);
Microsoft.TestPlatform.CoreUtilities (1)
Extensions\StringBuilderExtensions.cs (1)
36data = data.Substring(0, result.MaxCapacity - result.Length);
Microsoft.TestPlatform.CrossPlatEngine (1)
Utilities\TestCaseFilterDeterminer.cs (1)
13? testCaseFilter.Substring(0, MaxLengthOfTestCaseFilterToShow) + "..."
Microsoft.TestPlatform.Utilities (1)
XmlUtilities.cs (1)
85var parentNode = xmlDocument.SelectSingleNode(nodeXPath.Substring(0, nodeXPath.LastIndexOf('/')));
Microsoft.VisualBasic.Core (23)
Microsoft\VisualBasic\CompilerServices\LikeOperator.vb (8)
461Right = Right.Substring(RightStart, RightEnd - RightStart) 464Return CompareChars(Left.Substring(LeftStart, LeftEnd - LeftStart + 1), Right, Comparer, Options) 483CompareChars(Left.Substring(LeftStart, LeftEnd - LeftStart + 1 + NumberOfExtraCharsToCompare), Right.Substring(RightStart, RightEnd - RightStart + 1), Comparer, Options) 499Return CompareChars(Left.Substring(LeftStart, LeftEnd - LeftStart + 1), Right.Substring(RightStart, RightEnd - RightStart + 1), Comparer, Options) 685RangeStart = Pattern.Substring(PatternIndex, PatternNextIndex - PatternIndex + 1) 743RangeEnd = Pattern.Substring(PatternIndex, PatternNextIndex - PatternIndex + 1)
Microsoft\VisualBasic\CompilerServices\StringType.vb (1)
656TruncatedPattern = Pattern.Substring(0, PatternIndex) 'Remove the second * and everything trailing
Microsoft\VisualBasic\CompilerServices\Utils.LateBinder.vb (1)
419name = name.Substring(0, manglingCharIndex)
Microsoft\VisualBasic\CompilerServices\VB6InputFile.vb (1)
86sInput = sInput.Substring(1, sInput.Length - 2)
Microsoft\VisualBasic\ErrObject.vb (1)
199Me.HelpFile = HelpLink.Substring(0, iContext)
Microsoft\VisualBasic\FileIO\FileSystem.vb (1)
934TargetDirectoryFullPath.Substring(0, SourceDirectoryFullPath.Length).Equals(
Microsoft\VisualBasic\FileIO\TextFieldParser.vb (1)
971Field = Line.Substring(Index, DelimiterMatch.Index - Index)
Microsoft\VisualBasic\Information.vb (2)
406ArraySuffix = typename.Substring(pos, LastChar - pos + 1).Replace("["c, "("c).Replace("]"c, ")"c) 408typename = typename.Substring(0, pos)
Microsoft\VisualBasic\Strings.vb (7)
747Builder.Append(Expression.Substring(Start, FindLocation - Start)) 876sSubString = sSrc.Substring(iLastIndex, iIndex - iLastIndex) 930Return Source.Substring(0, Length) 944Return Source.Substring(0, Length) 1849Return [str].Substring(0, Length) 1905Return [str].Substring(Start - 1, Length) 1926Return [str].Substring(lStrLen - Length, Length)
Microsoft.VisualBasic.Forms (1)
Microsoft\VisualBasic\Interaction.vb (1)
83title = fullName.Substring(0, firstCommaLocation)
Microsoft.VisualStudio.TestPlatform.Common (1)
Utilities\SimpleJSON.cs (1)
673string s = aJSON.Substring(i + 1, 4);
Microsoft.VisualStudio.TestPlatform.Extensions.Trx.TestLogger (6)
Utility\Converter.cs (3)
600fullyQualifiedName.Substring(0, fullyQualifiedName.Length - testName.Length) : 606return nameToCheck.Substring(0, nameToCheck.LastIndexOf('.')); 612className = nameToCheck.Substring(0, nameToCheck.LastIndexOf("::", StringComparison.Ordinal));
XML\XmlPersistence.cs (3)
471attributeName = attributeName.Substring(0, 1).ToLowerInvariant() + attributeName.Substring(1); 589string defaultFieldLocation = fieldName.StartsWith("m_", StringComparison.Ordinal) ? fieldName.Substring(2, fieldName.Length - 2) : fieldName; 749string attributeName = location.Substring(1, location.Length - 1);
Microsoft.VisualStudio.TestPlatform.ObjectModel (6)
Nuget.Frameworks\FrameworkNameProvider.cs (1)
529var trimmed = profile.Substring(7, profile.Length - 7);
Nuget.Frameworks\NuGetFrameworkFactory.cs (5)
310string platform = versionStart > 0 ? profileShort.Substring(0, versionStart) : profileShort; 311string? platformVersionString = versionStart > 0 ? profileShort.Substring(versionStart, profileShort.Length - versionStart) : null; 428identifier = s.Substring(0, versionStart); 448version = s.Substring(versionStart, versionLength); 463profile = s.Substring(actualProfileStart, s.Length - actualProfileStart);
Microsoft.Web.Xdt.Extensions (1)
InsertOrAppendAttribute.cs (1)
67var value = trimmedArg.Substring(start, last - start);
Microsoft.Web.XmlTransform (3)
XmlAttributePreservationDict.cs (1)
68xmlDocString = elementStartTag.Substring(0, elementStartTag.Length-1) + "/>" ;
XmlTransforms.cs (2)
408strbuilder.Append(transformValue.Substring(position, match.Index - position)); 546strbuilder.Append(transformValue.Substring(position, match.Index - position));
Mono.Cecil (4)
Mono.Cecil\AssemblyNameReference.cs (1)
205 name.PublicKeyToken [j] = Byte.Parse (pk_token.Substring (j * 2, 2), NumberStyles.HexNumber);
Mono.Cecil\ModuleDefinition.cs (1)
1095 name = name.Substring (0, name.Length - 4);
Mono.Cecil\TypeParser.cs (2)
234 return fullname.Substring (start, position - start); 316 @namespace = fullname.Substring (0, last_dot);
Mono.Cecil.Pdb (1)
Mono.Cecil.Pdb\NativePdbReader.cs (1)
279 var alias_value = used_namespace.Substring (1, index - 1);
Mono.Cecil.Rocks (2)
Mono.Cecil.Rocks\DocCommentId.cs (2)
236 name = name.Substring (0, index); 261 name = type.Name.Substring (0, index);
MSBuild (4)
CommandLine\CommandLineParser.cs (2)
272switchName = unquotedCommandLineArg.Substring(switchIndicatorsLength, switchParameterIndicator - switchIndicatorsLength); 606string unquotedSwitchIndicatorAndName = QuotingUtilities.Unquote(commandLineArg.Substring(0, quotedSwitchParameterIndicator), out var doubleQuotesRemovedFromSwitchIndicatorAndName);
src\msbuild\src\Shared\Debugging\PrintLineDebuggerWriters.cs (1)
80var artifactsPart = executingAssembly.Substring(0, logIndex);
XMake.cs (1)
4620toolsVersionList = toolsVersionList.Substring(0, toolsVersionList.Length - 2);
NuGet.Build.Tasks (1)
GetRestoreSolutionProjectsTask.cs (1)
75projectPath = projectPath.Substring(0, projectPath.Length - MetaProjExtension.Length);
NuGet.Build.Tasks.Pack (2)
PackTaskLogic.cs (2)
1153var key = item.Substring(0, index); 1160var key = item.Substring(0, index);
NuGet.CommandLine.XPlat (2)
Commands\Package\PackageWithNuGetVersion.cs (1)
40packageId = token.Value.Substring(0, separatorIndex);
Commands\Package\PackageWithVersionRange.cs (1)
40packageId = token.Value.Substring(0, separatorIndex);
NuGet.Commands (9)
MSBuildProjectFactory.cs (3)
256projectDirectory = projectDirectory.Substring(0, projectDirectory.Length - 1); 276relativePath = relativePath.Substring(1, relativePath.Length - 1); 280relativePath = relativePath.Substring(0, relativePath.Length - 1);
RestoreCommand\CompatibilityChecker.cs (1)
196var withoutNi = name.Substring(0, name.Length - 3);
RestoreCommand\ContentFiles\ContentFileUtils.cs (2)
121var relativePath = file.Substring(rootFolderPathLength, file.Length - rootFolderPathLength); 241destination = destination.Substring(0, destination.Length - 3);
RestoreCommand\Utility\LockFileUtils.cs (2)
830string segmentValue = path.Substring(segmentStart, segmentLength); 988var emptyDir = firstItem.Path.Substring(0, firstItem.Path.Length - fileName.Length)
RestoreCommand\Utility\MSBuildRestoreUtility.cs (1)
1210return s.Substring(0, prefixWithoutSlashes.Length) + slashes + s.Substring(prefixWithoutSlashes.Length + 1);
NuGet.Common (3)
PathUtil\PathResolver.cs (1)
200string nonWildcardPortion = searchPath.Substring(0, directorySeparatoryIndex);
PathUtil\PathUtility.cs (1)
124return path.Substring(0, path.Length - 1) + trailingCharacter;
PathUtil\ProjectJsonPathUtilities.cs (1)
125projectName = file.Substring(0, prefixLength);
NuGet.Configuration (2)
Settings\Settings.cs (1)
680combinedPath = combinedPath.Substring(0, index);
Utility\XElementUtility.cs (1)
63textBeforeOrNull.Value = textBeforeOrNull.Value.Substring(0, textBeforeOrNull.Value.Length - oneIndentLevel.Length);
NuGet.DependencyResolver.Core (2)
Remote\RemoteDependencyWalker.cs (2)
489nearRelease.Substring(0, lengthToCompare), 490farRelease.Substring(0, lengthToCompare));
NuGet.Frameworks (6)
FrameworkNameProvider.cs (1)
541var trimmed = profile.Substring(7, profile.Length - 7);
NuGetFrameworkFactory.cs (5)
307string platform = versionStart > 0 ? profileShort.Substring(0, versionStart) : profileShort; 308string? platformVersionString = versionStart > 0 ? profileShort.Substring(versionStart, profileShort.Length - versionStart) : null; 425identifier = s.Substring(0, versionStart); 445version = s.Substring(versionStart, versionLength); 460profile = s.Substring(actualProfileStart, s.Length - actualProfileStart);
NuGet.PackageManagement (3)
Utility\FileSystemUtility.cs (1)
468yield return path.Substring(0, index);
Utility\MSBuildNuGetProjectSystemUtility.cs (1)
566truncatedPath = effectivePath.Substring(0, effectivePath.Length - extension.Length);
Utility\XElementExtensions.cs (1)
330textBeforeOrNull.Value = textBeforeOrNull.Value.Substring(0, textBeforeOrNull.Value.Length - oneIndentLevel.Length);
NuGet.Packaging (13)
ContentModel\Infrastructure\Parser.cs (1)
60var tokenName = pattern.Substring(beginName, endName - beginName);
Licenses\LicenseExpressionTokenizer.cs (1)
69processingToken = processingToken.Substring(0, processingToken.Length - 1);
Licenses\NuGetLicense.cs (1)
62var cleanIdentifier = licenseIdentifier.Substring(0, licenseIdentifier.Length - 1);
NuGetExtractionFileIO.cs (1)
131var mask = Convert.ToInt32(output.Substring(0, 4), 8);
PackageCreation\Authoring\PackageBuilder.cs (1)
1268return "R" + hex!.Substring(0, 16);
PackageExtraction\PackageHelper.cs (1)
109localRuntimePackageId = packageId.Substring(0, packageId.Length - packageLanguage!.Length - 1);
PackageFileExtractor.cs (1)
85file.Substring(0, directorySeparatorIndex) +
Rules\UpholdBuildConventionRule.cs (2)
105var folderName = file.Substring(index1 + 1, index2 - index1 - 1); 118return file.Substring(0, index + 1);
Signing\Content\KeyPairFileReader.cs (1)
85var key = line.Substring(0, pos);
Signing\DerEncoding\DerGeneralizedTime.cs (1)
73stringToParse = $"{decodedTime.Substring(0, 22)}Z";
Signing\DerEncoding\DerSequenceReader.cs (1)
468return value.Substring(0, newLength);
Signing\Timestamp\Rfc3161TimestampUtils.cs (1)
115string s = hexString.Substring(i, 2);
NuGet.ProjectModel (5)
LazyStringSplit.cs (1)
101Current = _input.Substring(_index, length);
PackageSpecUtility.cs (3)
22version = version.Substring(0, version.Length - 2); 26version = version.Substring(0, version.Length - 1) + snapshotValue; 46return NuGetVersion.TryParse(version.Substring(0, version.Length - 2), out _);
StringExtensions.cs (1)
23return (s.Substring(0, index),
NuGet.Versioning (9)
FloatRange.cs (3)
246var stablePart = versionString.Substring(0, dashPosition - 1); // Get the part without the * 268releasePrefix = releaseVersion.Substring(0, releaseVersion.Length - 1); 290var actualVersion = versionString.Substring(0, versionString.Length - 1);
SemanticVersionFactory.cs (3)
198versionString = value.Substring(0, endPos); 214var releaseLabel = value.Substring(start, endPos - start); 225buildMetadata = value.Substring(start, endPos - start);
VersionRange.cs (2)
380fixedReleaseLabel = lastLabel.Substring(0, lastLabel.Length - 2); 385fixedReleaseLabel = lastLabel.Substring(0, lastLabel.Length - 1);
VersionRangeFactory.cs (1)
174trimmedValue = trimmedValue.Substring(1, trimmedValue.Length - 2);
PresentationBuildTasks (39)
Microsoft\Build\Tasks\Windows\MarkupCompilePass1.cs (1)
1079newSourceDir = fullFilePath.Substring(0, pathEndIndex + 1);
Microsoft\Build\Tasks\Windows\MarkupCompilePass2.cs (1)
542newSourceDir = fullFilePath.Substring(0, pathEndIndex + 1);
Microsoft\Build\Tasks\Windows\UidManager.cs (1)
861prefix = uid.Substring(0, separatorIndex);
MS\Internal\MarkupCompiler\MarkupCompiler.cs (7)
479string targetPath = string.Concat(TargetPath, SourceFileInfo.RelativeSourceFilePath.Substring(0, pathEndIndex + 1)); 691sourceFileInfo.RelativeSourceFilePath = file.Path.Substring(0, fileExtIndex); 1401isValid = IsValidCLRNamespace(subClassFullName.Substring(0, index), false) && 1429ns = className.Substring(0, index); 2301genericName = genericName.Substring(0, bang); 2344genericName = genericName.Substring(0, bang); 2497string bns = baseClassFullName.Substring(0, dotIndex);
MS\Internal\MarkupCompiler\ParserExtension.cs (1)
266string ownerTagName = localAttribName.Substring(0, lastIndex);
MS\Internal\MarkupCompiler\VersionHelper.cs (1)
124TryGetValue(elements[i].Substring(0, idx), out values[i]);
MS\Internal\Tasks\CompilerWrapper.cs (2)
370newRelativeFilePath = newRelativeFilePath.Substring(0, fileExtIndex); 421newSourceDir = fullFilePath.Substring(0, pathEndIndex + 1);
src\wpf\src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\BamlMapTable.cs (1)
1165typeClrNamespace = typeFullName.Substring(0, dotIndex);
src\wpf\src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\MarkupExtensionParser.cs (6)
427args = attrValue.Substring(i, length-i); 565prefix = typename.Substring(0, typeIndex); 750prefix = typename.Substring(0, typeIndex); 1170args.Substring(i,length-(i)), lineNumber, linePosition); 1368string prefix = (nameIndex < 0) ? String.Empty : propertyName.Substring(0, nameIndex); 1506string prefix = (nameIndex < 0) ? String.Empty : name.Substring(0, nameIndex);
src\wpf\src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\StyleXamlParser.cs (3)
276string ownerTagName = localAttribName.Substring(0, lastIndex); 390target = propOrEvent.Substring(0, dotIndex); 397prefix = target.Substring(0, colonIndex);
src\wpf\src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\TemplateXamlParser.cs (3)
313string ownerTagName = localAttribName.Substring(0, lastIndex); 439target = propertyName.Substring(0, dotIndex); 446prefix = target.Substring(0, colonIndex);
src\wpf\src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\XamlReaderHelper.cs (3)
1657ownerName = longName.Substring(0, idx); 2489return _text.Substring(_start, _current - _start); 3053prefix = attribData.Args.Substring(0, colonIndex);
src\wpf\src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\XamlTypeMapper.cs (6)
350string assemblyShortName = assemblyName.Substring(0, indexComma).ToUpper(CultureInfo.InvariantCulture); 945globalClassName = localName.Substring(0, lastIndex); 2247prefix = typeName.Substring(0, typeIndex); 2258typeName = typeName.Substring(0, typeIndex); 2863string prefix = typeString.Substring(0, colonIndex); 2945string prefix = typeString.Substring(0, colonIndex);
src\wpf\src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\TokenizerHelper.cs (1)
92return _str.Substring(_currentTokenIndex,_currentTokenLength);
src\wpf\src\Microsoft.DotNet.Wpf\src\Shared\System\Windows\Markup\XmlCompatibilityReader.cs (2)
970string prefix = pair.Substring(0, colonIndex); 971string elementName = pair.Substring(colonIndex + 1, length - 1 - colonIndex);
PresentationCore (17)
MS\Internal\FontCache\CanonicalFontFamilyReference.cs (1)
169locationString = normalizedString.Substring(0, i);
MS\Internal\FontCache\FamilyCollection.cs (1)
383familyName = familyName.Substring(0, indexOfSpace);
MS\Internal\FontCache\FontCacheUtil.cs (4)
606return NormalizeFontFamilyReference(friendlyName.Substring(startIndex, length).Replace(",,", ",")); 652return fontFamilyReference.Substring(startIndex, length).ToUpperInvariant(); 657string location = fontFamilyReference.Substring(startIndex, fragmentIndex - startIndex); 658string fragment = fontFamilyReference.Substring(fragmentIndex, (startIndex + length) - fragmentIndex);
MS\Internal\FontCache\FontResourceCache.cs (2)
73escapedPath = escapedPath.Substring(0, escapedPath.Length - FakeFileName.Length); 122folderName = resourceFullName.Substring(0, indexOfLastSlash + 1);
MS\Internal\IO\Packaging\DeobfuscatingStream.cs (1)
340guidBytes[i] = Convert.ToByte(wellFormedGuidString.Substring(i * 2, 2), 16);
System\Windows\Input\Command\KeyGesture.cs (2)
254keyGestureToken = keyGestures.Substring(0, index); 267keyDisplayString = displayStrings.Substring(0, index);
System\Windows\Input\Command\KeyGestureConverter.cs (2)
92fullName = fullName.Substring(0, index).Trim(); 103modifiersToken = fullName.Substring(0, index);
System\Windows\Input\Command\MouseGestureConverter.cs (1)
65modifiersToken = fullName.Substring(0,Offset);
System\Windows\Markup\XmlLanguage.cs (1)
685return languageTag.Substring (0, i);
System\Windows\Media\Parsers.cs (1)
146string tokens = trimmedColor.Substring(3, trimmedColor.Length - 3);
System\Windows\Navigation\BaseUriHelper.cs (1)
256firstSegment = original.Substring(start, end - start);
PresentationFramework (86)
Microsoft\Win32\FileDialog.cs (1)
591newFilename = fileName.Substring(0, fileName.Length - currentExtension.Length);
MS\Internal\Data\PathParser.cs (3)
142SetError(nameof(SR.PathSyntax), _path.Substring(0, _index), _path.Substring(_index)); 194SetError(nameof(SR.UnmatchedParen), _path.Substring(0, _index)); 198string name = _path.Substring(start, _index - start).Trim();
MS\Internal\Globalization\BamlResourceDeserializer.cs (4)
89_reader.Name.Substring(0, _reader.Name.LastIndexOf('.')), 115_reader.Name.Substring(0, _reader.Name.LastIndexOf('.')), 198_reader.Name.Substring(0, _reader.Name.LastIndexOf('.')), 267_reader.Name.Substring(0, _reader.Name.LastIndexOf('.')),
MS\Internal\Globalization\BamlTreeUpdater.cs (1)
771nameSpace = fullTypeName.Substring(0, lastDot);
MS\Internal\IO\Packaging\XamlFilter.cs (1)
290String result = _currentContent.Substring(_countOfCharactersReturned, numCharactersToReturn);
MS\Internal\Markup\StaticExtension.cs (2)
70string typeString = Member.Substring(0, dotIndex); 92Member = Member.Substring(dotIndex + 1, Member.Length - dotIndex - 1);
MS\Internal\TraceData.cs (1)
270name = name.Substring(0, name.Length - suffix.Length);
System\Windows\Controls\TextRangeAdaptor.cs (1)
1860return (text.Length <= maxLength || maxLength == -1) ? text : text.Substring(0, maxLength);
System\Windows\Controls\TextSearch.cs (1)
271Prefix = prefix.Substring(0, prefix.Length - lastChar.Length);
System\Windows\Documents\FixedPage.cs (2)
640String inputUriStringWithoutFragment = inputUriString.Substring(0, inputUriString.IndexOf('#')); 1098fixedPage.StartPartUriString = startPartUriString.Substring(0, startPartUriString.IndexOf('#'));
System\Windows\Documents\FixedSOMTextRun.cs (1)
146run.Text = s.Substring(startIndex, endIndex-startIndex);
System\Windows\Documents\NLGSpellerInterop.cs (1)
645public string Text => SourceString?.Substring(TextRange.Start, TextRange.Length);
System\Windows\Documents\RtfToXamlReader.cs (11)
3660entry.Name = entry.Name.Substring(0, iCP); 3727lhs_name = name.Substring(0, i); 3728lhs_tag = name.Substring(i + 1, name.Length - i - 1); 3733rhs_name = value.Substring(0, i); 3734rhs_tag = value.Substring(i + 1, value.Length - i - 1); 8168string imageXaml = dnImage.Xaml.Substring(0, uriSourceIndex); 8330pictureUri = instructionName.Substring(uriIndex, instructionName.Length - uriIndex - 1); 8335pictureUri = pictureUri.Substring(0, pictureUriEndIndex); 8387string param = instr.Substring(iStart, iEnd - iStart); 8597string name = instr.Substring(iStart, i - iStart); 11358string subtext = text.Substring(nStart, nEnd - nStart);
System\windows\Documents\TextEditor.cs (4)
1188textData = textData.Substring(0, splitPosition); 1194textData = textData.Substring(0, extraCharsAllowed-1); 1228textData = textData.Substring(0, endOfFirstLine); 1233textData = textData.Substring(0, endOfFirstLine);
System\windows\Documents\TextEditorCopyPaste.cs (2)
960end.InsertTextInRun(pastedText.Substring(currentLineStart, i - currentLineStart)); 986end.InsertTextInRun(pastedText.Substring(currentLineStart, pastedText.Length - currentLineStart));
System\Windows\Documents\TextFindEngine.cs (3)
523string subString = textString.Substring(i, j - i + 1); 556if ((!matchKashida || IsKashidaMatch(textString.Substring(i, j - i + 1), findPattern, compareInfo)) && 557(!matchAlefHamza || IsAlefHamzaMatch(textString.Substring(i, j - i + 1), findPattern, compareInfo)))
System\Windows\Documents\TextRangeSerialization.cs (1)
570string assembly = (index == -1 ? elementTypeStandardized.Module.Name : elementTypeStandardized.Module.Name.Substring(0, index));
System\Windows\Documents\WinRTSpellerInterop.cs (1)
959public string Text => SourceString?.Substring(TextRange.Start, TextRange.Length);
System\Windows\Documents\WinRTSpellerInteropExtensions.cs (1)
178var altForm = documentText.Substring(lastToken.TextRange.Start, lastTokenText.Length + i).TrimEnd('\0').TrimEnd();
System\Windows\Documents\XamlToRtfParser.cs (5)
325token.Text = _xaml.Substring(startIndex, _xamlIndex - startIndex); 808AddParseData(xaml.Substring(startIndex, xamlIndex - startIndex)); 848AddParseData(xaml.Substring(startIndex, xamlIndex - startIndex)); 894AddParseData(xaml.Substring(startIndex, xamlIndex - startIndex)); 975AddParseData(xaml.Substring(startIndex, xamlIndex - startIndex));
System\Windows\Documents\XamlToRtfWriter.cs (2)
2459string newCharacters = characters.Substring(index, end - index); 2655string prefix = xaml.Substring(iStart, iEnd - iStart);
System\Windows\Documents\ZoomPercentageConverter.cs (1)
165zoomString = zoomString.Substring(0, zoomString.Length - 1);
System\Windows\Input\Command\CommandConverter.cs (1)
232typeName = localName.Substring(0, Offset);
System\Windows\Input\Command\CommandValueSerializer.cs (1)
128string typeName = value.Substring(0, dotIndex);
System\Windows\Markup\BamlMapTable.cs (1)
1165typeClrNamespace = typeFullName.Substring(0, dotIndex);
System\Windows\Markup\BamlReader.cs (4)
389_ownerTypeName = info.Name.Substring(0, index); 436_ownerTypeName = cpInfo.Name.Substring(0, index); 2084_ownerTypeName = nodeInfo.Name.Substring(0, index); 2155_ownerTypeName = nodeInfo.Name.Substring(0, index);
System\Windows\Markup\BamlRecordReader.cs (1)
4204string resourceName = resourceNameString.Substring(1, resourceNameString.Length-2);
System\Windows\Markup\BamlRecords.cs (1)
4387_typeFullName.Substring(0, periodIndex) :
System\Windows\Markup\BamlWriter.cs (1)
532prefix = data.Args.Substring(0, colonIndex);
System\Windows\Markup\DependencyPropertyConverter.cs (1)
139string typeName = value.Substring(0, lastIndex);
System\Windows\Markup\MarkupExtensionParser.cs (6)
427args = attrValue.Substring(i, length-i); 565prefix = typename.Substring(0, typeIndex); 750prefix = typename.Substring(0, typeIndex); 1170args.Substring(i,length-(i)), lineNumber, linePosition); 1368string prefix = (nameIndex < 0) ? String.Empty : propertyName.Substring(0, nameIndex); 1506string prefix = (nameIndex < 0) ? String.Empty : name.Substring(0, nameIndex);
System\Windows\Markup\Primitives\MarkupWriter.cs (2)
475name = name.Substring(0, name.Length - EXTENSIONLENGTH); 1043name = name.Substring(0, name.Length - EXTENSIONLENGTH);
System\Windows\Markup\RoutedEventConverter.cs (2)
67string typeName = routedEventName.Substring(0, lastIndex); 157nsPrefix = nameString.Substring(0, nsIndex);
System\Windows\Markup\RoutedEventValueSerializer.cs (1)
59Type type = typeSerializer.ConvertFromString(value.Substring(0, index), context) as Type;
System\Windows\Markup\XamlTypeMapper.cs (9)
945globalClassName = localName.Substring(0, lastIndex); 1645globalClassName = localName.Substring(0,lastIndex); 1772string globalClassName = localName.Substring(0,lastIndex); 2167prefix = typeName.Substring(0, colonIndex); 2168typeName = typeName.Substring(colonIndex+1, typeName.Length-colonIndex-1); 2247prefix = typeName.Substring(0, typeIndex); 2258typeName = typeName.Substring(0, typeIndex); 2863string prefix = typeString.Substring(0, colonIndex); 3034nsPrefix = nameString.Substring (0, nsIndex);
System\Windows\Markup\XamlTypeMapperSchemaContext.cs (1)
271clrNamespace = xmlNamespace.Substring(clrNsIndex, assemblyIndex - clrNsIndex);
System\Windows\PropertyPath.cs (3)
567name = name.Substring(1, name.Length-2); 574string ownerName = name.Substring(0, lastIndex).Trim(); 831nsPrefix = name.Substring(0, nsIndex).TrimEnd();
System\Windows\Shell\ThumbButtonInfo.cs (1)
111text = text.Substring(0, 259);
ReachFramework (7)
MS\Internal\Printing\Configuration\WinSpoolPrinterCapabilities.cs (1)
564str = str.Substring(0, index);
PrintConfig\PrtCap_Reader.cs (1)
536string prefix = (colonIndex == (-1)) ? "" : QName.Substring(0, colonIndex);
PrintConfig\PrtTicket_Editor.cs (1)
422string prefix = (colonIndex == (-1)) ? "" : QName.Substring(0, colonIndex);
Serialization\ImageSourceTypeConverter.cs (1)
421imageMimeType = mimetypes.Substring(0, comma);
Serialization\VisualTreeFlattener.cs (1)
143string uri = string.Concat(m_mainFile.Substring(0, index), "_", bitmapName);
Serialization\XpsFontSubsetter.cs (1)
685guidByteArray[i] = Convert.ToByte(guidString.Substring(i * 2, 2), 16);
Serialization\XpsImageSerializationService.cs (1)
142string subString = imageMimeType.Substring(start, comma);
RepoTasks (1)
src\aspnetcore\src\Shared\CertificateGeneration\UnixCertificateManager.cs (1)
361? Path.Combine("$HOME", certDir[homeDirectoryWithSlash.Length..])
Roslyn.Diagnostics.Analyzers (30)
src\roslyn\src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (9)
63s = s.Substring(0, lastSeparator); 181return path.Substring(0, i); 246return path.Substring(0, 1); 282return path.Substring(0, i); 289? path.Substring(0, 3) 290: path.Substring(0, 2); 313? path.Substring(0, 1) 506return path.Substring(0, path.Length - 1); 880var volumeSpecifier = isDriveRooted ? p.Substring(0, 2) : string.Empty;
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\CompilerOptionParseUtilities.cs (1)
61string name = feature.Substring(0, equals);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\FileNameUtilities.cs (2)
118return path.Substring(0, index); 124return path.Substring(0, path.Length - 1);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\StringExtensions.cs (1)
214return arg.Substring(1, arg.Length - 2);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\StringTable.cs (1)
325var text = chars.Substring(start, len);
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\WellKnownTypeProvider.cs (1)
224namespaceNamesBuilder.Add(fullTypeName[prevStartIndex..i]);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormattingResult.cs (1)
83var oldText = (change.Span == span) ? originalString : originalString.Substring(change.Span.Start - span.Start, change.Span.Length);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\FormattingExtensions.cs (1)
261newText = newText[i..];
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Naming\IdentifierNameParts.cs (2)
47? newBaseName[prefix.Length..] 77words.Add(name.Substring(part.Start, part.Length));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.cs (8)
147name = StripCommonPrefixes(name[Prefix.Length..], out var prefix); 178=> name.Substring(wordSpan.Start, wordSpan.Length); 311name = StripCommonPrefixes(name.StartsWith(Prefix) ? name[Prefix.Length..] : name, out _); 379return name[index..]; 390name = name[Prefix.Length..^Suffix.Length]; 411newWords[i] = name[parts[i].Start..parts[i].End]; 431return name + Suffix[i..]; 457if (name.StartsWith(Prefix[i..]))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.cs (1)
344foreach (var ch in _symbolKeyData[position..])
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (1)
629var substring = Data[start..end];
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (1)
399return name.Substring(p.Start, p.Length).ToCamelCase();
Roslyn.Diagnostics.CSharp.Analyzers (4)
NumberCommentsRefactoring.cs (1)
101var separatedNumbers = text[commentStartIndex..eolOrEofIndex];
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\Trivia\TriviaRewriter.cs (1)
93var leadingTrivia = SyntaxFactory.ParseLeadingTrivia(text[width..]);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\FormattingHelpers.cs (1)
31indent = indent[start..];
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeSymbolExtensions.TypeSyntaxGeneratorVisitor.cs (1)
153? null : symbol.Signature.UnmanagedCallingConventionTypes.Select(type => GetConventionForString(type.Name["CallConv".Length..])),
Roslyn.Diagnostics.VisualBasic.Analyzers (7)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Formatting\Engine\Trivia\TriviaDataFactory.vb (1)
116Debug.Assert(originalString.Substring(0, 4) = " _" & vbCrLf)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\EnumMemberGenerator.vb (4)
108Dim firstTwoChars = numericText.Substring(0, 2) 114Dim lastTwoChars = numericText.Substring(numericText.Length - 2, 2) 127Return SyntaxFactory.NumericLiteralExpression(SyntaxFactory.IntegerLiteralToken(numericText.Substring(0, 2) + Convert.ToString(value, 8), LiteralBase.Octal, TypeCharacter.None, IntegerUtilities.ToUnsigned(value))) 129Return SyntaxFactory.NumericLiteralExpression(SyntaxFactory.IntegerLiteralToken(numericText.Substring(0, 2) + Convert.ToString(value, 2), LiteralBase.Binary, TypeCharacter.None, IntegerUtilities.ToUnsigned(value)))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\StringExtensions.vb (2)
26withoutSuffix = identifierText.Substring(0, identifierText.Length - 9) 68unescaped = text.Substring(1, text.Length() - 2)
rzc (4)
CommandLine\AnsiConsole.cs (2)
81var text = message.Substring(escapeScan, escapeIndex - escapeScan); 92if (int.TryParse(message.Substring(startIndex, endIndex - startIndex), out value))
CommandLine\CommandOption.cs (1)
38ValueName = part.Substring(1, part.Length - 2);
PipeName.cs (1)
53.Substring(0, 25) // We only have ~50 total characters on Mac, so strip that down
sdk-tasks (1)
ProcessRuntimeAnalyzerVersions.cs (1)
36var version = recursiveDir.Substring(0, slashIndex);
Security.TransportSecurity.IntegrationTests (10)
Http\ClientCredentialTypeTests.4.1.0.cs (6)
34string username = Guid.NewGuid().ToString("n").Substring(0, 8); 35string password = Guid.NewGuid().ToString("n").Substring(0, 16); 36string realm = Guid.NewGuid().ToString("n").Substring(0, 5); 95string username = Guid.NewGuid().ToString("n").Substring(0, 8); 96string password = Guid.NewGuid().ToString("n").Substring(0, 16); 97string realm = Guid.NewGuid().ToString("n").Substring(0, 5);
Https\ClientCredentialTypeTests.4.1.0.cs (4)
50username = Guid.NewGuid().ToString("n").Substring(0, 8); 51password = Guid.NewGuid().ToString("n").Substring(0, 16); 125username = Guid.NewGuid().ToString("n").Substring(0, 8); 126password = Guid.NewGuid().ToString("n").Substring(0, 16);
SelectTests (4)
Program.cs (3)
573var name = "run_" + job["job:".Length..].Replace('-', '_'); 886=> token.StartsWith("job:", StringComparison.Ordinal) ? token["job:".Length..] : token; 1127t => t.StartsWith("job:", StringComparison.Ordinal) ? t["job:".Length..] : t,
TestSelector.cs (1)
478target.StartsWith("test:", StringComparison.Ordinal) ? target["test:".Length..] : target;
SuperFileCheck (2)
Program.cs (2)
324var prefix = lineStr.Substring(0, index); 332return lineStr.Substring(0, index) + $"{transformSuffix}: {{{{^ *}}}}" + lineStr.Substring(index + syntaxDirective.Length) + "{{$}}";
System.CodeDom (10)
Microsoft\CSharp\CSharpCodeGenerator.cs (2)
2778sb.Append(CreateEscapedIdentifier(baseType.Substring(lastIndex, i - lastIndex))); 2785sb.Append(CreateEscapedIdentifier(baseType.Substring(lastIndex, i - lastIndex)));
Microsoft\VisualBasic\VBCodeGenerator.cs (3)
2393value = value.Substring(1, value.Length - 2); 2485sb.Append(CreateEscapedIdentifier(baseType.Substring(lastIndex, i - lastIndex))); 2492sb.Append(CreateEscapedIdentifier(baseType.Substring(lastIndex, i - lastIndex)));
src\runtime\src\libraries\Common\src\System\CodeDom\CodeTypeReference.cs (5)
199subTypeNames.Push(typeName.Substring(current + 1, subTypeNameEndIndex - current - 1)); 212subTypeNames.Push(typeName.Substring(current + 1, subTypeNameEndIndex - current - 1)); 234CodeTypeReference type = new CodeTypeReference(typeName.Substring(0, end + 1), Options); 259_baseType = typeName.Substring(0, end + 1); 389result = typeName.Substring(start, index - start);
System.CommandLine (5)
Completions\CompletionContext.cs (1)
90var textBeforeCursor = rawInput!.Substring(0, position!.Value);
Help\HelpBuilder.cs (1)
383yield return part.Substring(i, length);
Parsing\StringExtensions.cs (3)
83? arg.Substring(1, colonIndex - 1) // [name:value] 84: arg.Substring(1, arg.Length - 2); // [name] is a legal directive 317first = arg.Substring(0, i);
System.ComponentModel.Composition (1)
System\ComponentModel\Composition\ContractNameServices.cs (1)
323genericName = genericName.Substring(0, indexOfBackQuote);
System.ComponentModel.Primitives (3)
System\ComponentModel\Design\Serialization\DesignerSerializerAttribute.cs (1)
75baseType = baseType.Substring(0, comma);
System\ComponentModel\DesignerAttribute.cs (1)
106baseType = baseType.Substring(0, comma);
System\ComponentModel\EditorAttribute.cs (1)
89baseType = baseType.Substring(0, comma);
System.ComponentModel.TypeConverter (14)
src\runtime\src\libraries\Common\src\System\Drawing\ColorConverterCommon.cs (1)
44string colorName = text.Substring(1, text.Length - 2);
System\ComponentModel\PropertyDescriptor.cs (1)
406typeName = typeName.Substring(0, comma);
System\ComponentModel\ReflectTypeDescriptionProvider.cs (1)
1063t = Type.GetType(typeName.Substring(0, commaIndex));
System\ComponentModel\ReflectTypeDescriptionProvider.ReflectedTypeData.cs (1)
545t = Type.GetType(typeName.Substring(0, commaIndex));
System\Drawing\PointConverter.cs (2)
47int x = (int)converter.ConvertFromString(context, culture, strValue[ranges[0]])!; 48int y = (int)converter.ConvertFromString(context, culture, strValue[ranges[1]])!;
System\Drawing\RectangleConverter.cs (4)
47int x = (int)converter.ConvertFromString(context, culture, strValue[ranges[0]])!; 48int y = (int)converter.ConvertFromString(context, culture, strValue[ranges[1]])!; 49int width = (int)converter.ConvertFromString(context, culture, strValue[ranges[2]])!; 50int height = (int)converter.ConvertFromString(context, culture, strValue[ranges[3]])!;
System\Drawing\SizeConverter.cs (2)
47int width = (int)converter.ConvertFromString(context, culture, strValue[ranges[0]])!; 48int height = (int)converter.ConvertFromString(context, culture, strValue[ranges[1]])!;
System\Drawing\SizeFConverter.cs (2)
47float width = (float)converter.ConvertFromString(context, culture, strValue[ranges[0]])!; 48float height = (float)converter.ConvertFromString(context, culture, strValue[ranges[1]])!;
System.Composition.Hosting (1)
System\Composition\Hosting\Util\Formatters.cs (1)
39var name = closedGenericType.Name.Substring(0, closedGenericType.Name.IndexOf('`'));
System.Composition.Runtime (1)
System\Composition\Runtime\Util\Formatters.cs (1)
27var name = closedGenericType.Name.Substring(0, closedGenericType.Name.IndexOf('`'));
System.Configuration.ConfigurationManager (7)
System\Configuration\AppSettingsReader.cs (1)
60return val.Substring(1, val.Length - 2);
System\Configuration\BaseConfigurationRecord.cs (1)
2150group = configKey.Substring(0, lastSlash);
System\Configuration\ClientConfigPaths.cs (2)
355_companyName = firstDot != -1 ? ns.Substring(0, firstDot) : ns; 387? validated.Substring(0, MaxLengthToUse)
System\Configuration\ClientConfigurationHost.cs (1)
265string parentUri = streamName.Substring(0, index + 1);
System\Configuration\XmlUtil.cs (2)
901startElement = formattedElement.Substring(0, iEndElement); 906startElement = formattedElement.Substring(0, iEndElement - 2);
System.Console (2)
src\runtime\src\libraries\Common\src\System\Text\EncodingHelper.Unix.cs (1)
58locale.Substring(dotPos, atPos - dotPos); // has modifier
System\TermInfo.cs (1)
169string printfFormat = format.Substring(pos - 1, printfEnd + 2); // extract the format string
System.Data.Common (9)
src\runtime\src\libraries\Common\src\System\Data\Common\AdapterUtil.cs (2)
176unquotedString = quotedString.Substring(prefixLength, quotedStringLength - (prefixLength + suffixLength)).Replace(quoteSuffix + quoteSuffix, quoteSuffix); 180unquotedString = quotedString.Substring(prefixLength, quotedStringLength - prefixLength);
src\runtime\src\libraries\Common\src\System\Data\Common\DbConnectionOptions.Common.cs (2)
451keyvalue = keyvalue.Substring(1, keyvalue.Length - 2).Replace("\"\"", "\""); 454keyvalue = keyvalue.Substring(1, keyvalue.Length - 2).Replace("\'\'", "\'");
System\Data\DataTable.cs (2)
3735current = current.Substring(1, current.Length - 2); 6518CurrentTableNamespace = CurrentTableFullName.Substring(0, nsSeparator);
System\Data\Filter\FunctionNode.cs (1)
461return ((string)argumentValues[0]).Substring(start, length);
System\Data\XDRSchema.cs (1)
306strType = dt[parts[1]];
System\Data\XMLSchema.cs (1)
2775prefix = QualifiedTableName.Substring(0, QualifiedTableName.IndexOf(':'));
System.Data.Odbc (7)
src\runtime\src\libraries\Common\src\System\Data\Common\AdapterUtil.cs (2)
176unquotedString = quotedString.Substring(prefixLength, quotedStringLength - (prefixLength + suffixLength)).Replace(quoteSuffix + quoteSuffix, quoteSuffix); 180unquotedString = quotedString.Substring(prefixLength, quotedStringLength - prefixLength);
src\runtime\src\libraries\Common\src\System\Data\Common\DbConnectionOptions.Common.cs (2)
451keyvalue = keyvalue.Substring(1, keyvalue.Length - 2).Replace("\"\"", "\""); 454keyvalue = keyvalue.Substring(1, keyvalue.Length - 2).Replace("\'\'", "\'");
System\Data\Odbc\OdbcConnection.cs (1)
231ProviderInfo.IsV3Driver = (int.Parse(ProviderInfo.DriverVersion.Substring(0, 2), CultureInfo.InvariantCulture) >= 3);
System\Data\Odbc\OdbcDataReader.cs (2)
2855str = str.Substring(1, str.Length - 2); 2935qualifiers[parts] = name.Substring(startPos, currentPos - startPos);
System.Data.OleDb (7)
DbConnectionOptions.cs (2)
804keyvalue = keyvalue.Substring(1, keyvalue.Length - 2).Replace("\"\"", "\""); 807keyvalue = keyvalue.Substring(1, keyvalue.Length - 2).Replace("\'\'", "\'");
OleDbConnectionString.cs (1)
115_expandedConnectionString = _expandedConnectionString!.Substring(0, position) + udlConnectionString + ';' + _expandedConnectionString.Substring(position);
System\Data\Common\AdapterUtil.cs (2)
1246unquotedString = quotedString.Substring(prefixLength, quotedStringLength - (prefixLength + suffixLength)).Replace(quoteSuffix + quoteSuffix, quoteSuffix); 1250unquotedString = quotedString.Substring(prefixLength, quotedStringLength - prefixLength);
System\Data\ProviderBase\DbConnectionPoolCounters.cs (2)
258result = $"{result.Substring(0, firstPartLength)}{insertString}{result.Substring(result.Length - lastPartLength, lastPartLength)}";
System.Diagnostics.DiagnosticSource (16)
System\Diagnostics\Activity.cs (3)
1397return id.Substring(3, 32); 1406return id.Substring(rootStart, rootEnd - rootStart); 1434return parentId.Substring(0, trimPosition) + overflowSuffix + '#';
System\Diagnostics\DsesFilterAndTransform.cs (9)
133listenerNameFilter = filterAndPayloadSpec.Substring(startIdx, slashIdx - startIdx); 138activityName = filterAndPayloadSpec.Substring(atIdx + 1, endEventNameIdx - atIdx - 1); 139eventNameFilter = filterAndPayloadSpec.Substring(slashIdx + 1, atIdx - slashIdx - 1); 143eventNameFilter = filterAndPayloadSpec.Substring(slashIdx + 1, endEventNameIdx - slashIdx - 1); 148listenerNameFilter = filterAndPayloadSpec.Substring(startIdx, endEventNameIdx - startIdx); 175eventSource.Message("DiagnosticSource: Parsing Explicit Transform '" + filterAndPayloadSpec.Substring(specStartIdx, endIdx - specStartIdx) + "'"); 360eventSource.Message("DiagnosticSource: Parsing Explicit Transform '" + filterAndPayloadSpec.Substring(specStartIdx, endIdx - specStartIdx) + "'"); 610_outputName = transformSpec.Substring(startIdx, equalsIdx - startIdx); 622string propertyName = transformSpec.Substring(idIdx, endIdx - idIdx);
System\Diagnostics\LegacyPropagator.cs (2)
171WebUtility.UrlDecode(baggageString.Substring(keyStart, keyEnd - keyStart)).Trim(s_trimmingSpaceCharacters), 172WebUtility.UrlDecode(baggageString.Substring(valueStart, currentIndex - valueStart)).Trim(s_trimmingSpaceCharacters)));
System\Diagnostics\Metrics\MetricsEventSource.cs (1)
734spec.MeterName.Substring(0, spec.MeterName.Length - 1));
System\Diagnostics\W3CPropagator.cs (1)
76traceId = traceId.Substring(0, TraceParentCoreLength);
System.Diagnostics.EventLog (1)
System\Diagnostics\EventLogEntry.cs (1)
352uint.TryParse(msg.Substring(percentIdx + 1, lasNumIdx - percentIdx - 1), out paramMsgID);
System.Diagnostics.PerformanceCounter (1)
System\Diagnostics\PerformanceCounterLib.cs (1)
1734instanceName = instanceName.Substring(0, SharedPerformanceCounter.InstanceNameMaxLength);
System.Diagnostics.Process (6)
src\runtime\src\libraries\Common\src\Interop\Linux\cgroups\Interop.cgroups.cs (3)
407if (Array.IndexOf(line[lineParts[1]].Split(','), subsystem) < 0) 413path = line[lineParts[2]]; 423path = line[lineParts[2]];
src\runtime\src\libraries\Common\src\System\IO\StringParser.cs (3)
91return _buffer.Substring(_startIndex, _endIndex - _startIndex); 119string result = _buffer.Substring(_startIndex + 1, lastParen - _startIndex - 1); 134return _buffer.Substring(_startIndex, _endIndex - _startIndex);
System.DirectoryServices (24)
System\DirectoryServices\ActiveDirectory\ConfigSet.cs (1)
443if ((bindingInfo.Length > prefix.Length) && (string.Equals(bindingInfo.Substring(0, prefix.Length), prefix, StringComparison.OrdinalIgnoreCase)))
System\DirectoryServices\ActiveDirectory\DirectoryContext.cs (2)
588domainName = responseBuffer.callerName.Substring(0, index); 605domainName = identity.Name.Substring(0, index);
System\DirectoryServices\ActiveDirectory\DomainController.cs (7)
671osVersion = osVersion.Substring(0, index); 1289int year = (int)int.Parse(dateTime.Substring(0, 4), NumberFormatInfo.InvariantInfo); 1290int month = (int)int.Parse(dateTime.Substring(4, 2), NumberFormatInfo.InvariantInfo); 1291int day = (int)int.Parse(dateTime.Substring(6, 2), NumberFormatInfo.InvariantInfo); 1292int hour = (int)int.Parse(dateTime.Substring(8, 2), NumberFormatInfo.InvariantInfo); 1293int min = (int)int.Parse(dateTime.Substring(10, 2), NumberFormatInfo.InvariantInfo); 1294int sec = (int)int.Parse(dateTime.Substring(12, 2), NumberFormatInfo.InvariantInfo);
System\DirectoryServices\ActiveDirectory\Utils.cs (14)
151dnsName = dsNameResultItem.name.Substring(0, dsNameResultItem.name.Length - 1); 563resultList.Add(distinguishedName.Substring(nextTokenStart, i - nextTokenStart)); 578resultList.Add(distinguishedName.Substring(nextTokenStart, i - nextTokenStart + 1)); 604domain = tmpUsername.Substring(0, index); 1162propertyName = propertyNameWithRangeInfo.Substring(0, index); 1786str.Append(filterValue.Substring(0, index)); 1881return Compare(s1.Substring(offset1, length1), s2.Substring(offset2, length2)); 1888return Compare(s1.Substring(offset1, length1), s2.Substring(offset2, length2), compareFlags); 1914serverName = serverName.Substring(1, serverName.Length - 2); //2 for [] 1925serverName = serverName.Substring(1, closingBrace - 1); 1946serverName = serverName.Substring(0, lastColon); 1960s_NTAuthorityString = ntLocalSystem.Value.Substring(0, index);
System.DirectoryServices.AccountManagement (5)
System\DirectoryServices\AccountManagement\AD\ADStoreCtx.cs (3)
1551sddlSid = sddlSid.Substring(0, index) + "-" + ((uint)primaryGroupId).ToString(CultureInfo.InvariantCulture); 2454string.Equals(component.Substring(0, 3), "DC=", StringComparison.OrdinalIgnoreCase)) 2465dnsDomainName = dnsDomainName.Substring(0, dnsDomainName.Length - 1);
System\DirectoryServices\AccountManagement\AD\SDSUtils.cs (1)
791string.Equals(component.Substring(0, 3), "DC=", StringComparison.OrdinalIgnoreCase))
System\DirectoryServices\AccountManagement\Utils.cs (1)
98byte b = byte.Parse(s.Substring(i * 2, 2), NumberStyles.AllowHexSpecifier, CultureInfo.InvariantCulture);
System.Drawing.Common (3)
System\Drawing\FontConverter.cs (3)
195style = font[styleIndex..]; 198sizeStr = font.Substring(nameIndex + 1, styleIndex - nameIndex - 1); 291units = text[splitPoint..];
System.Drawing.Primitives (4)
src\runtime\src\libraries\Common\src\System\Drawing\ColorConverterCommon.cs (1)
44string colorName = text.Substring(1, text.Length - 2);
System\Drawing\ColorTranslator.cs (3)
236c = Color.FromArgb(Convert.ToInt32(htmlColor.Substring(1, 2), 16), 237Convert.ToInt32(htmlColor.Substring(3, 2), 16), 238Convert.ToInt32(htmlColor.Substring(5, 2), 16));
System.Formats.Tar (1)
src\runtime\src\libraries\Common\src\System\IO\PathInternal.cs (1)
217path.Substring(0, path.Length - 1) :
System.IO.FileSystem.AccessControl (2)
src\runtime\src\libraries\Common\src\System\IO\FileSystem.DirectoryCreation.Windows.cs (1)
53string dir = fullPath.Substring(0, i + 1);
src\runtime\src\libraries\Common\src\System\IO\PathInternal.cs (1)
217path.Substring(0, path.Length - 1) :
System.IO.FileSystem.Watcher (1)
src\runtime\src\libraries\Common\src\System\IO\PathInternal.cs (1)
217path.Substring(0, path.Length - 1) :
System.IO.Packaging (11)
System\IO\Packaging\InternalRelationshipCollection.cs (1)
595return string.Concat("R", Guid.NewGuid().ToString("N").Substring(0, TimestampLength));
System\IO\Packaging\PackUriHelper.cs (3)
213partName = partName.Substring(0, partName.Length - file.Length); 269path = path.Substring(0, path.Length - partNameWithoutExtension.Length - RelationshipPartExtensionName.Length - 1); 274path = path.Substring(0, path.Length - RelationshipPartSegmentName.Length); // Removing rels segment
System\IO\Packaging\PackUriHelper.PackUriScheme.cs (1)
92absolutePackageUri = absolutePackageUri.Substring(0, absolutePackageUri.IndexOf('#'));
System\IO\Packaging\PartBasedPackageProperties.cs (1)
627if (!object.ReferenceEquals(ns, reader.LookupNamespace(typeValue.Substring(0, index)))
System\IO\Packaging\XmlCompatibilityReader.cs (2)
906string prefix = pair.Substring(0, colonIndex); 907string elementName = pair.Substring(colonIndex + 1, length - 1 - colonIndex);
System\IO\Packaging\ZipPackagePartPiece.cs (3)
81else if (path.Substring(0, searchPosition).EndsWith(PartPieceLastExtension, StringComparison.OrdinalIgnoreCase)) 106success = int.TryParse(path.Substring(digitStart, searchPosition - digitStart), out pieceNumber); 128prefixName = path.Substring(searchOffset, searchPosition - searchOffset);
System.Management (27)
System\Management\ManagementDateTime.cs (17)
144var tempString = dmtf.Substring(0, 4); 149tempString = dmtf.Substring(4, 2); 154tempString = dmtf.Substring(6, 2); 159tempString = dmtf.Substring(8, 2); 164tempString = dmtf.Substring(10, 2); 169tempString = dmtf.Substring(12, 2); 174tempString = dmtf.Substring(15, 6); 179tempString = dmtf.Substring(22, 3); 182tempString = dmtf.Substring(21, 4); 278strMicrosec = strMicrosec.Substring(0, 6); 332if (dmtfts.Substring(21, 4) != ":000") 342tempString = dmtfts.Substring(0, 8); 345tempString = dmtfts.Substring(8, 2); 348tempString = dmtfts.Substring(10, 2); 351tempString = dmtfts.Substring(12, 2); 354tempString = dmtfts.Substring(15, 6); 433strMicrosec = strMicrosec.Substring(0, 6);
System\Management\ManagementQuery.cs (8)
145tokenValue = q.Substring(0, i); 992tempProp = q.Substring(0, i); 1002tempProp = q.Substring(0, i); 1675tempSourceObject = q.Substring(0, i).TrimEnd(null); 2192tempSourceObject = q.Substring(0, i).TrimEnd(null); 3061w = q.Substring(0, i).Trim(); 3083tempProp = q.Substring(0, i); 3093tempProp = q.Substring(0, i);
System\Management\WMIGenerator.cs (2)
827string strFirstChar = strTemp.Substring(0, 1).ToUpperInvariant(); 857strClass = OriginalClassName.Substring(0, OriginalClassName.IndexOf('_'));
System.Memory (1)
System\Buffers\ReadOnlySequence.cs (1)
498return text.Substring(start, length);
System.Net.Http (38)
System\Net\Http\Headers\AuthenticationHeaderValue.cs (2)
147input.Substring(startIndex, schemeLength); 188string parameter = input.Substring(parameterStartIndex, parameterEndIndex - parameterStartIndex + 1);
System\Net\Http\Headers\CacheControlHeaderValue.cs (1)
530destination.Add(valueString.Substring(current, tokenLength));
System\Net\Http\Headers\ContentDispositionHeaderValue.cs (6)
269dispositionType = input.Substring(startIndex, typeLength); 351return IsQuoted(nameParameter.Value) ? nameParameter.Value!.Substring(1, nameParameter.Value.Length - 2) : nameParameter.Value; 400result = result.Substring(1, result.Length - 2); 473Encoding encoding = Encoding.GetEncoding(processedInput[parts[1]]); 474byte[] bytes = Convert.FromBase64String(processedInput[parts[3]]); 508string encodingString = input.Substring(0, quoteIndex);
System\Net\Http\Headers\ContentRangeHeaderValue.cs (1)
176string unit = input.Substring(startIndex, unitLength);
System\Net\Http\Headers\EntityTagHeaderValue.cs (1)
131parsedValue = new EntityTagHeaderValue(input.Substring(current, tagLength), isWeak, false);
System\Net\Http\Headers\GenericHeaderParser.cs (2)
138parsedValue = value.Substring(startIndex, hostLength); 146parsedValue = value.Substring(startIndex, resultLength);
System\Net\Http\Headers\MediaTypeHeaderValue.cs (1)
265mediaType = input.Substring(startIndex, mediaTypeLength);
System\Net\Http\Headers\NameValueHeaderValue.cs (2)
229string name = input.Substring(startIndex, nameLength); 257parsedValue._value = input.Substring(current, valueLength);
System\Net\Http\Headers\ProductHeaderValue.cs (2)
123string name = input.Substring(startIndex, nameLength); 144string version = input.Substring(current, versionLength);
System\Net\Http\Headers\ProductInfoHeaderValue.cs (1)
139comment = input.Substring(current, commentLength);
System\Net\Http\Headers\RangeHeaderValue.cs (1)
151result._unit = input.Substring(startIndex, unitLength);
System\Net\Http\Headers\StringWithQualityHeaderValue.cs (1)
104string value = input.Substring(startIndex, valueLength);
System\Net\Http\Headers\TransferCodingHeaderValue.cs (1)
81string value = input.Substring(startIndex, valueLength);
System\Net\Http\Headers\ViaHeaderValue.cs (5)
166string receivedBy = input.Substring(current, receivedByLength); 180comment = input.Substring(current, commentLength); 220protocolName = input.Substring(startIndex, protocolVersionOrNameLength); 232protocolVersion = input.Substring(current, protocolVersionOrNameLength); 240protocolVersion = input.Substring(startIndex, protocolVersionOrNameLength);
System\Net\Http\Headers\WarningHeaderValue.cs (2)
167string text = input.Substring(textStartIndex, textLength); 192agent = input.Substring(current, agentLength);
System\Net\Http\HttpContent.cs (1)
144encoding = Encoding.GetEncoding(charset.Substring(1, charset.Length - 2));
System\Net\Http\HttpUtilities.cs (2)
22return hostHeader.Substring(0, colonPos); 29return hostHeader.Substring(0, colonPos);
System\Net\Http\SocketsHttpHandler\AuthenticationHelper.Digest.cs (1)
311return data.Substring(start, length);
System\Net\Http\SocketsHttpHandler\HttpEnvironmentProxy.cs (5)
78value = value.Substring(0, idx); 84domain = value.Substring(0, idx); 205user = auth.Substring(0, separatorIndex); 215value = value.Substring(0, delimiterIndex); 227host = value.Substring(0, separatorIndex);
System.Net.Http.Json (1)
System\Net\Http\Json\JsonHelpers.cs (1)
41encoding = Encoding.GetEncoding(charset.Substring(1, charset.Length - 2));
System.Net.HttpListener (18)
src\runtime\src\libraries\Common\src\System\Net\CookieParser.cs (2)
142_tokenStream.Substring(_start, _tokenLength) : 856? value.Substring(1, value.Length - 2)
System\Net\HttpListenerRequest.cs (4)
379values.Add(s.Substring(i, ci - i)); 569name = s.Substring(si, ti - si); 570value = s.Substring(ti + 1, i - ti - 1); 574value = s.Substring(si, i - si);
System\Net\HttpListenerRequestUriBuilder.cs (3)
204if (!AppendUnicodeCodePointValuePercentEncoded(_rawPath.Substring(index + 1, 4))) 213if (!AddPercentEncodedOctetToRawOctetsList(_rawPath.Substring(index, 2))) 429return AddSlashToAsteriskOnlyPath(uriString.Substring(pathStartIndex, queryIndex - pathStartIndex));
System\Net\Managed\HttpListenerContext.Managed.cs (1)
76username = authString.Substring(0, colonPos);
System\Net\Managed\HttpListenerRequest.Managed.cs (2)
86_method = req[parts[0]]; 93_rawUrl = req[parts[1]];
System\Net\Managed\ListenerPrefix.cs (3)
116_host = uri.Substring(start_host, colon - start_host); 124_host = uri.Substring(start_host, root - start_host); 129_path = _path.Substring(0, _path.Length - 1);
System\Net\ServiceNameStore.cs (3)
61hostAndPort = hostPortAndDistinguisher.Substring(0, nextSlashIndex); // Excludes Slash 73host = hostAndPort.Substring(0, colonIndex); // Excludes colon 249return uriPrefix.Substring(i, j - i);
System.Net.Mail (7)
System\Net\Mail\Attachment.cs (1)
209return cid.Substring(1, cid.Length - 2);
System\Net\Mail\MailAddress.cs (1)
158displayName = displayName.Substring(1, displayName.Length - 2);
System\Net\Mail\MailAddressParser.cs (3)
254domain = data.Substring(index + 1, startingIndex - index); 342localPart = data.Substring(index + 1, startingIndex - index); 400displayName = data.Substring(leftIndex, firstNonCommentIndex - leftIndex);
System\Net\Mail\MailBnfHelper.cs (1)
245return data.Substring(start, i);
System\Net\Mime\MimeBasePart.cs (1)
109return Encoding.GetEncoding(value[subStrings[1]]);
System.Net.NetworkInformation (10)
src\runtime\src\libraries\Common\src\System\IO\RowConfigReader.cs (1)
116value = _buffer.Substring(valueIndex, valueLength); // Grab the whole value string.
src\runtime\src\libraries\Common\src\System\IO\StringParser.cs (3)
91return _buffer.Substring(_startIndex, _endIndex - _startIndex); 119string result = _buffer.Substring(_startIndex + 1, lastParen - _startIndex - 1); 134return _buffer.Substring(_startIndex, _endIndex - _startIndex);
System\Net\NetworkInformation\StringParsingHelpers.Connections.cs (1)
18string tcpLineData = sockstatFile.Substring(indexOfTcp, endOfTcpLine - indexOfTcp);
System\Net\NetworkInformation\StringParsingHelpers.Misc.cs (1)
93string ipData = snmp4FileContents.Substring(secondIpHeader, endOfSecondLine - secondIpHeader);
System\Net\NetworkInformation\StringParsingHelpers.Statistics.cs (4)
183string icmpData = fileContents.Substring(secondIpHeader, endOfSecondLine - secondIpHeader); 270string ipData = fileContents.Substring(secondIpHeader, endOfSecondLine - secondIpHeader); 337string tcpData = fileContents.Substring(secondTcpHeader, endOfSecondLine - secondTcpHeader); 369string tcpData = fileContents.Substring(secondUdpHeader, endOfSecondLine - secondUdpHeader);
System.Net.Primitives (5)
src\runtime\src\libraries\Common\src\System\Net\CookieParser.cs (2)
142_tokenStream.Substring(_start, _tokenLength) : 856? value.Substring(1, value.Length - 2)
System\Net\Cookie.cs (3)
448m_path = path.Substring(0, lastSlash); 451m_path = path.Substring(0, path.LastIndexOf('/')); // May be empty 457m_path = path.Substring(0, path.LastIndexOf('/') + 1);
System.Net.Requests (13)
System\Net\CommandStream.cs (4)
203string sendCommand = _commands[_index].Command.Substring(0, _commands[_index].Command.Length - 2); 621_buffer = szResponse.Substring(szResponse.Length - unusedChars, unusedChars); 665state.Resp.StatusDescription = responseString.Substring(0, completeLength); 668if (NetEventSource.Log.IsEnabled()) NetEventSource.Info(this, $"Received response: {responseString.Substring(0, completeLength - 2)}");
System\Net\FtpControlStream.cs (7)
787path = path.Substring(0, path.Length - 1); 799directory = path.Substring(0, index + 1); 805directory = directory.Substring(0, directory.Length - 1); 1046return str.Substring(firstQuote + 1, lastQuote - firstQuote - 1); 1089string addressInfo = responseString.Substring(pos1 + 1, pos2 - pos1 - 1); 1200response.StatusCodeString = responseString.Substring(0, 3); 1237if (responseString.Substring(lineStart, 3) == response.StatusCodeString)
System\Net\HttpWebRequest.cs (1)
1569if (!string.Equals(curRange.Substring(0, curRange.IndexOf('=')), rangeSpecifier, StringComparison.OrdinalIgnoreCase))
System\Net\WebRequest.cs (1)
262cookedUri = cookedUri.Substring(0, cookedUri.Length - 1);
System.Net.WebHeaderCollection (1)
System\Net\WebHeaderCollection.cs (1)
317string name = header.Substring(0, colpos);
System.Private.CoreLib (39)
src\runtime\src\libraries\Common\src\System\IO\PathInternal.cs (1)
217path.Substring(0, path.Length - 1) :
src\runtime\src\libraries\Common\src\System\IO\StringParser.cs (3)
91return _buffer.Substring(_startIndex, _endIndex - _startIndex); 119string result = _buffer.Substring(_startIndex + 1, lastParen - _startIndex - 1); 134return _buffer.Substring(_startIndex, _endIndex - _startIndex);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Environment.GetFolderPathCore.Unix.cs (1)
237line.Substring(pos, endPos - pos);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Environment.Unix.cs (1)
23return dotPos < 0 ? hostName : hostName.Substring(0, dotPos);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Environment.UnixOrBrowser.cs (1)
33string key = name.Substring(lastPos + 1, pos - lastPos - 1);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Environment.Variables.Unix.cs (1)
82return value.Substring(0, index);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\CalendarData.cs (1)
302this.saAbbrevEraNames[0] = this.saEraNames[0].Substring(2, 2);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\CultureData.cs (2)
2050return str.Substring(start, end - start + 1); 2195result[index++] = digits.Substring(start, ffffPos - start);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\CultureData.Icu.cs (1)
167_sName = collationStart < 0 || _bNeutral ? _sRealName : _sRealName.Substring(0, collationStart);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\CultureInfo.cs (1)
285culture = new CultureInfo(name.Substring(0, idx));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\IdnMapping.cs (1)
659string asciiSlice = ascii.Substring(index, count);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\JapaneseCalendar.Icu.cs (1)
144return eraNames[eraIndex].Substring(0, 1);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\StringInfo.cs (2)
95return String[start..end]; 127return str.Substring(index, nextTextElementLength);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\TextElementEnumerator.cs (1)
62currentSubstr = _str.Substring(_currentTextElementOffset, _currentTextElementLength);
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\FileSystemInfo.cs (1)
56return FullPath.Substring(i, length - i);
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\Path.cs (2)
69return path.Substring(0, subLength); 138return end >= 0 ? PathInternal.NormalizeDirectorySeparators(path.Substring(0, end)) : null;
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\StringReader.cs (1)
190string result = s.Substring(pos, foundLineLength);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Memory.cs (1)
212return (_object is string str) ? str.Substring(_index, _length) : Span.ToString();
src\runtime\src\libraries\System.Private.CoreLib\src\System\ReadOnlyMemory.cs (1)
141return (_object is string str) ? str.Substring(_index, _length) : Span.ToString();
src\runtime\src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\SymbolType.cs (1)
254_format = format.Substring(curIndex, length);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\Loader\AssemblyLoadContext.cs (1)
893string parentAssemblyName = assemblyName.Name.Substring(0, assemblyName.Name.Length - SatelliteSuffix.Length);
src\runtime\src\libraries\System.Private.CoreLib\src\System\String.Manipulation.cs (4)
1207return Substring(0, startIndex); 1960splitStrings[arrIndex++] = Substring(currIndex, sepList[i] - currIndex); 2727return this[index..(endIndex + 2)]; 2794return this[index..];
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\EncodingTable.cs (3)
120webNames[webNameIndices[i]..webNameIndices[i + 1]], 147encodingInfoList[codePage] = new EncodingInfo(codePage, webNames[webNameIndices[i]..webNameIndices[i + 1]], 222string webName = WebNames[WebNameIndices[index]..WebNameIndices[index + 1]];
src\runtime\src\libraries\System.Private.CoreLib\src\System\TimeZoneInfo.Unix.cs (1)
1115zoneAbbreviations.Substring(index, lastIndex - index) :
src\runtime\src\libraries\System.Private.CoreLib\src\System\TimeZoneInfo.Unix.NonAndroid.cs (1)
205timeZoneId = zoneTabFileLine.Substring(startIndex, length);
src\runtime\src\libraries\System.Reflection.Metadata\src\System\Reflection\Metadata\TypeName.cs (1)
187_fullName = _fullName.Substring(0, _nestedNameLength);
System\Reflection\Runtime\General\ThunkedApis.cs (2)
213ns = fullname.Substring(0, nsDelimiter); 215name = fullname.Substring(nsDelimiter + 1, nameLength);
System\Reflection\Runtime\TypeInfos\RuntimeTypeInfo.GetMember.cs (1)
38string prefix = optionalNameOrPrefix.Substring(0, optionalNameOrPrefix.Length - 1);
System.Private.DataContractSerialization (17)
src\runtime\src\libraries\Common\src\System\CodeDom\CodeTypeReference.cs (5)
199subTypeNames.Push(typeName.Substring(current + 1, subTypeNameEndIndex - current - 1)); 212subTypeNames.Push(typeName.Substring(current + 1, subTypeNameEndIndex - current - 1)); 234CodeTypeReference type = new CodeTypeReference(typeName.Substring(0, end + 1), Options); 259_baseType = typeName.Substring(0, end + 1); 389result = typeName.Substring(start, index - start);
System\Runtime\Serialization\DataContract.cs (4)
1509typeName = typeName.Substring(0, iParam); 1713ns = fullTypeName.Substring(0, nsEnd); 1718localName = localName.Substring(0, iParam); 1938throw new InvalidDataContractException(SR.Format(SR.GenericParameterNotValid, format.Substring(start, i - start), genericNameProvider.GetGenericTypeName(), genericNameProvider.GetParameterCount() - 1));
System\Runtime\Serialization\EnumDataContract.cs (1)
386throw XmlObjectSerializer.CreateSerializationException(SR.Format(SR.InvalidEnumValueOnRead, value.Substring(index, count), DataContract.GetClrTypeFullName(UnderlyingType)));
System\Runtime\Serialization\Json\JsonReaderDelegator.cs (1)
45name = qname.Substring(0, colon);
System\Runtime\Serialization\Json\XmlObjectSerializerReadContextComplexJson.cs (1)
235name = qname.Substring(0, colon);
System\Runtime\Serialization\SchemaExporter.cs (1)
282typeName = typeName.Substring(0, iParam);
System\Runtime\Serialization\XmlObjectSerializerReadContext.cs (1)
444prefix = qname.Substring(0, colon);
System\Xml\XmlBaseReader.cs (2)
535prefix = name.Substring(0, index); 1021prefix = name.Substring(0, index);
System\Xml\XmlConverter.cs (1)
460prefix = qname.Substring(0, index).Trim();
System.Private.Uri (28)
System\DomainNameHelper.cs (1)
97return str.Substring(start, end - start);
System\Uri.cs (24)
943pathSegments.Append(path.Substring(current, (next - current) + 1)); 1008? _string.Substring(start + 1, _info.Offset.Query - start - 1) 1009: _string.Substring(start, _info.Offset.Query - start); 1219host.Substring(1, host.Length - 2); 2120_string = _string.Substring(0, idx); 2138_string = _string.Substring(0, idx); 2519host = str.Substring(idx, end - idx); 2968return _string.Substring(_info.Offset.Scheme, _info.Offset.Path - _info.Offset.Scheme); 2981return _string.Substring(_info.Offset.Host, _info.Offset.Path - _info.Offset.Host); 2991return _string.Substring(_info.Offset.Scheme, _info.Offset.End - _info.Offset.Scheme); 3004return _string.Substring(_info.Offset.Scheme, _info.Offset.Fragment - _info.Offset.Scheme); 3008return _string.Substring(_info.Offset.Scheme, _info.Offset.Path - _info.Offset.Scheme); 3015return _string.Substring(_info.Offset.Scheme, _info.Offset.Fragment - _info.Offset.Scheme); 3021return _string.Substring(_info.Offset.Scheme, _info.Offset.User - _info.Offset.Scheme); 3034return (idx - _info.Offset.Host == 0) ? string.Empty : _string.Substring(_info.Offset.Host, 3050return _string.Substring(delimiterAwareIdx, _info.Offset.Query - delimiterAwareIdx); 3062return _string.Substring(delimiterAwareIdx, _info.Offset.Fragment - delimiterAwareIdx); 3074return _string.Substring(delimiterAwareIdx, _info.Offset.End - delimiterAwareIdx); 3078_string.Substring(_info.Offset.User, _info.Offset.Path - _info.Offset.User); 3088return _string.Substring(_info.Offset.Path, _info.Offset.Fragment - _info.Offset.Path); 3100return _string.Substring(_info.Offset.Scheme, _info.Offset.End - _info.Offset.Scheme); 3103return _string.Substring(_info.Offset.Path, _info.Offset.End - _info.Offset.Path); 3119return _string.Substring(_info.Offset.User, delimiterAwareIdx - _info.Offset.User); 3695newHost = _originalUnicodeString.Substring(0, startOffset);
System\UriBuilder.cs (3)
86_query = extraValue.Substring(0, fragmentIndex); 122value = value.Substring(0, index); 321_username = userInfo.Substring(0, index);
System.Private.Xml (52)
System\Xml\Core\XmlCharCheckingWriter.cs (1)
159writer.WriteCData(text.Substring(0, i + 2));
System\Xml\Core\XmlCharCheckingWriterAsync.cs (1)
108await writer.WriteCDataAsync(text.Substring(0, i + 2)).ConfigureAwait(false);
System\Xml\Core\XmlTextReaderImpl.cs (2)
9656return value.Substring(startPos, i - startPos); 9675return (startPos == 0) ? value : value.Substring(startPos, len - startPos);
System\Xml\Dom\XmlCharacterData.cs (1)
92return _data!.Substring(offset, count);
System\Xml\Dom\XmlEntityReference.cs (1)
190buf = baseURI.Substring(0, nCount);
System\Xml\Dom\XmlNode.cs (1)
1295prefix = name.Substring(0, colonPos);
System\Xml\Schema\DtdParser.cs (3)
283_schemaInfo.DocTypeName = new XmlQualifiedName(_nameTable.Add(docTypeName.Substring(0, colonPos)), 3571return value.Substring(startPos, i - startPos); 3590return (startPos == 0) ? value : value.Substring(startPos, len - startPos);
System\Xml\Schema\XmlAtomicValue.cs (1)
415return value.Substring(0, colonOffset);
System\Xml\Serialization\CodeIdentifier.cs (2)
198EscapeKeywords(name.Substring(0, nameEnd), sb); 263identifier = identifier.Substring(0, identifier.Length - 2);
System\Xml\Serialization\Mappings.cs (1)
121return new XmlQualifiedName(XmlConvert.EncodeLocalName(name.Substring(colon + 1)), XmlConvert.EncodeLocalName(name.Substring(0, colon))).ToString();
System\Xml\Serialization\ReflectionXmlSerializationWriter.cs (1)
479string? choiceNs = colon < 0 ? choiceMapping.Namespace : xmlName.Substring(0, colon);
System\Xml\Serialization\Types.cs (3)
1049name = name.Substring(0, arity); 1463ns = type.Substring(0, nsLen); 1471name = type.Substring(nsLen + 1, nameLen - nsLen - 1);
System\Xml\Serialization\XmlReflectionImporter.cs (3)
2020if (xmlName.Substring(0, xmlName.Length - 1) == anyNs) 2029string? choiceNs = colon < 0 ? choiceMapping.Namespace : xmlName.Substring(0, colon); 2153string choiceNs = colon < 0 ? "" : choiceId.Substring(0, colon);
System\Xml\Serialization\XmlSerializationReader.cs (3)
814attr.Value = $"{_r.LookupNamespace(attr.Value.Substring(0, colon))}:{attr.Value.AsSpan(colon + 1)}"; 1177string? prefix = colon < 0 ? null : value!.Substring(0, colon); 1958xsiTypeNs = Reader.LookupNamespace((colon >= 0) ? value.Substring(0, colon) : "");
System\Xml\Serialization\XmlSerializationReaderILGen.cs (2)
2864LocalBuilder localA = ilg.GetLocal(source.Substring(0, index)); 2934LocalBuilder localA = ilg.GetLocal(source.Substring(0, index));
System\Xml\Serialization\XmlSerializationWriter.cs (2)
1023string prefix = localName.Substring(0, colon); 1808string assemblyName = (iComma > -1) ? assemblyFullName.Substring(0, iComma) : assemblyFullName;
System\Xml\Serialization\XmlSerializationWriterILGen.cs (1)
2302string? choiceNs = colon < 0 ? choiceMapping.Namespace : xmlName.Substring(0, colon);
System\Xml\ValidateNames.cs (4)
289prefix = s.Substring(0, colonOffset); 322localName = s.Substring(0, len); 340localName = s.Substring(offset, lenLocal); 613prefix = name.Substring(0, colonPos);
System\Xml\XmlComplianceUtil.cs (2)
52return value.Substring(startPos, i - startPos); 86return value.Substring(startPos, len - startPos);
System\Xml\XPath\Internal\StringFunctions.cs (2)
152return (idx < 1) ? string.Empty : s1.Substring(0, idx); 197return str1.Substring((int)num, (int)num1);
System\Xml\XPath\Internal\XPathScanner.cs (3)
292return XmlConvert.ToXPathDouble(_xpathExpr.Substring(start, len)); 305return XmlConvert.ToXPathDouble(_xpathExpr.Substring(start, len)); 324return _xpathExpr.Substring(start, len);
System\Xml\Xsl\QIL\QilReference.cs (1)
49value = value.Substring(0, MaxDebugNameLength);
System\Xml\Xsl\Runtime\XsltFunctions.cs (3)
45return (idx < 1) ? string.Empty : s1.Substring(0, idx); 92return value.Substring((int)startIndex, (int)(endIndex - startIndex)); 512string prefix = name.Substring(0, colonOffset);
System\Xml\Xsl\XPath\XPathScanner.cs (3)
143return _xpathExpr.Substring(_lexStart, _curIndex - _lexStart); 524_stringValue = _xpathExpr.Substring(startIdx, endIdx - startIdx); 543return _xpathExpr.Substring(start, _curIndex - start);
System\Xml\Xsl\Xslt\QilGenerator.cs (1)
1027return i > start ? _f.String(source.Substring(start, i - start)) : null;
System\Xml\Xsl\XsltOld\ContainerAction.cs (1)
477if (!PrefixQName.ValidatePrefix(name.Substring(0, idx)))
System\Xml\Xsl\XsltOld\NumberAction.cs (1)
715formatInfo.formatString = formatString.Substring(count, length - count);
System\Xml\Xsl\XsltOld\PrefixQName.cs (2)
46local = qname.Substring(0, position); 61local = qname.Substring(startLocalNamePos, len);
System.Private.Xml.Linq (3)
System\Xml\Linq\XNamespace.cs (2)
226return _names.Add(new XName(this, localName.Substring(index, count))); 258refNamespace = s_namespaces.Add(new WeakReference<XNamespace>(new XNamespace(namespaceName.Substring(index, count))));
System\Xml\Linq\XNodeReader.cs (1)
1147XNamespace? ns = e.GetNamespaceOfPrefix(qualifiedName.Substring(0, i));
System.Reflection.Emit (1)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\SymbolType.cs (1)
254_format = format.Substring(curIndex, length);
System.Reflection.Metadata (2)
System\Reflection\Metadata\Internal\NamespaceCache.cs (1)
261parentName = childName.Substring(0, lastIndex);
System\Reflection\Metadata\TypeName.cs (1)
187_fullName = _fullName.Substring(0, _nestedNameLength);
System.Reflection.MetadataLoadContext (2)
System\Reflection\TypeLoading\General\Helpers.cs (1)
207ns = fullName.Substring(0, indexOfLastDot);
System\Reflection\TypeLoading\RuntimeTypeInfo.GetMember.cs (1)
36string prefix = optionalNameOrPrefix!.Substring(0, optionalNameOrPrefix.Length - 1);
System.Runtime.InteropServices.JavaScript (4)
System\Runtime\InteropServices\JavaScript\JSHostImplementation.cs (4)
330return s.Substring(head, tail - head + 1); 337var assembly = fqn.Substring(SmallIndexOf(fqn, '[') + 1, SmallIndexOf(fqn, ']') - 1); 342var className = fqn.Substring(0, SmallIndexOf(fqn, ':')); 350nameSpace = fqn.Substring(0, idx);
System.Runtime.Serialization.Schema (2)
System\Runtime\Serialization\Schema\CodeExporter.cs (2)
484string containingTypeName = originalName.Substring(0, nestedTypeIndex); 1466identifier = identifier.Substring(0, MaxIdentifierLength - requiredLength);
System.Security.Cryptography.Xml (2)
System\Security\Cryptography\Xml\Utils.cs (2)
322idref = idref.Substring(startId + 3, endId - startId - 3); 344idref = idref.Substring(startId + 3, endId - startId - 3);
System.ServiceModel.Federation (1)
System\ServiceModel\Security\SecurityUtils.cs (1)
45return addressingVersionString.Substring(pos + 1, addressingVersionString.Length - pos - 2);
System.ServiceModel.NetNamedPipe (2)
System\ServiceModel\Channels\PipeConnectionInitiator.cs (2)
417path = path.Substring(0, path.Length - 1); 420return path.Substring(0, path.LastIndexOf('/') + 1);
System.ServiceModel.Primitives (16)
Internals\System\Runtime\UrlUtility.cs (4)
76return UrlPathEncode(str.Substring(0, i)) + str.Substring(i); 539name = s.Substring(si, ti - si); 540value = s.Substring(ti + 1, i - ti - 1); 544value = s.Substring(si, i - si);
Internals\System\Xml\XmlMtomReader.cs (1)
3165return data.Substring(start, offset - start);
System\IdentityModel\Claims\X509CertificateClaimSet.cs (2)
484s_identifier = x509ExtensionFormattedString.Substring(0, delimiterIndex); 500s_separator = x509ExtensionFormattedString.Substring(separatorFirstChar, separatorLength);
System\ServiceModel\Channels\TextMessageEncoder.cs (3)
198charSet = contentType.Substring(charsetValueIndex, semiColonIndex - charsetValueIndex); 204charSet = charSet.Substring(1, charSet.Length - 2); 351charSet = charSet.Substring(1, charSet.Length - 2);
System\ServiceModel\Description\ServiceReflector.cs (2)
65string result = nameEnd > 0 ? t.Name.Substring(0, nameEnd) : t.Name; 971return method.Name.Substring(0, method.Name.Length - AsyncMethodNameSuffix.Length);
System\ServiceModel\FaultReason.cs (1)
126localLang = localLang.Substring(0, idx);
System\ServiceModel\XmlUtil.cs (3)
67return s.Substring(0, i); 112return s.Substring(i, j - i); 133prefix = TrimStart(qname.Substring(0, index));
System.Speech (31)
Internal\AlphabetConverter.cs (2)
159token = source.Substring(startIndex, i - startIndex + 1); 320key = from.Substring(0, j + 1);
Internal\ObjectToken\RegistryDataKey.cs (1)
474firstKey = registryPath.Substring(0, index);
Internal\ObjectToken\SAPICategories.cs (1)
276string sInteger = s.Substring(iPosPrev, iPosDot);
Internal\PhonemeConverter.cs (1)
85string sCur = sPhone.Substring(iPos, iPosNext - iPos);
Internal\SrgsCompiler\AppDomainGrammarProxy.cs (1)
286pairs[i]._name = parameter.Substring(0, posColon);
Internal\SrgsCompiler\RuleRef.cs (1)
55sbExternalRuleUri.Append(posPound > 0 ? id.Substring(0, posPound) : id);
Internal\SrgsCompiler\SrgsElementCompilerFactory.cs (1)
262string pron = pronunciation.Substring(iCurPron, iDeliminator - iCurPron);
Internal\SrgsParser\XmlParser.cs (5)
171string sToken = sChars.Substring(i, iTokenEnd - i); 369grammar.Culture = _langId = new CultureInfo(reader.Value.Substring(0, pos)); 1683name = sTag.Substring(0, iEqual).Trim(Helpers._achTrimChars); 1709value = sTag.Substring(iEqual, iEndQuote - iEqual); 1780minRepeat = Convert.ToInt32(repeat.Substring(0, sep), CultureInfo.InvariantCulture);
Internal\Synthesis\SSmlParser.cs (7)
135culture = new CultureInfo(reader.Value.Substring(0, pos)); 1496if (!float.TryParse(time.Substring(0, pos), out fDuration)) 1508if (!float.TryParse(time.Substring(0, pos), out fDuration)) 1545if (!percent || !TryParseNumber(contour.Substring(start, comma - (start + 1)), ref timePosition) || timePosition.SsmlAttributeId == ProsodyNumber.AbsoluteNumber) 1549if (!TryParseHz(contour.Substring(comma, parenthesis - (comma + 1)), ref target, true, out hz)) 1692if (decimal.TryParse(sNumber.Substring(0, sNumber.Length - 1), out value)) 1755fResult = TryParseNumber(sNumber.Substring(0, sNumber.Length - 2), ref number) && (acceptHzRelative || number.SsmlAttributeId == ProsodyNumber.AbsoluteNumber);
Internal\Synthesis\TextFragmentEngine.cs (1)
79baseUri = baseUri.Substring(0, posSlash);
Internal\Synthesis\VoiceSynthesis.cs (4)
185text = e.Prompt._text.Substring(e.CharacterPosition, e.CharacterCount); 204StringBuilder sb = new(text.Substring(0, curPos)); 243sb.Append(text.Substring(curPos, len)); 253return sb.ToString().Substring(start, length);
Recognition\Grammar.cs (1)
866pairs[i]._name = parameter.Substring(0, posColon);
Recognition\RecognizerBase.cs (2)
1417baseUri = new Uri(uri.Substring(0, posSlash + 1), UriKind.RelativeOrAbsolute); 1492bstrResourceUri = bstrResourceUri.Substring(0, posGreaterThan);
Recognition\SrgsGrammar\SrgsElementFactory.cs (1)
58string sSubPron = sPron.Substring(iCurPron, iDeliminator - iCurPron);
Recognition\SrgsGrammar\SrgsToken.cs (1)
124string subPronunciation = _pronunciation.Substring(iCurPron, iDeliminator - iCurPron);
Result\RecognizedPhrase.cs (1)
1107return name.Substring(0, name.LastIndexOf('_'));
System.Text.Encoding.CodePages (1)
System\Text\EncodingTable.cs (1)
158string name = names.Substring(indices[i], indices[i + 1] - indices[i]);
System.Text.Json (3)
System\ReflectionExtensions.cs (1)
569string friendSimpleName = comma < 0 ? friendName : friendName.Substring(0, comma);
System\Text\Json\Serialization\Metadata\DefaultJsonTypeInfoResolver.Helpers.cs (1)
188return genericAritySeparatorIndex < 0 ? name : name.Substring(0, genericAritySeparatorIndex);
System\Text\Json\ThrowHelper.Serialization.cs (1)
507message = $"{message.Substring(0, iPos)} Path: {path} |{message.Substring(iPos)}";
System.Text.Json.SourceGeneration (1)
JsonSourceGenerator.Emitter.cs (1)
1973contextTypeName = contextTypeName.Substring(0, backTickIndex);
System.Text.RegularExpressions (7)
System\Text\RegularExpressions\Capture.cs (1)
55public string Value => Text is string text ? text.Substring(Index, Length) : string.Empty;
System\Text\RegularExpressions\Regex.Split.cs (3)
301state.results.Add(state.input.Substring(state.prevat, match.Index - state.prevat)); 329state.results.Add(state.input.Substring(match.Index + match.Length, state.prevat - match.Index - match.Length)); 349state.results.Add(input.Substring(0, state.prevat));
System\Text\RegularExpressions\RegexParser.cs (3)
1504return _pattern.Substring(startpos, _pos - startpos); 1717string capname = _pattern.Substring(startpos, _pos - startpos); 2198_concatenation!.AddChild(new RegexNode(RegexNodeKind.Multi, _options & ~RegexOptions.IgnoreCase, _pattern.Substring(pos, cch)));
System.Text.RegularExpressions.Generator (3)
src\runtime\src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexParser.cs (3)
1504return _pattern.Substring(startpos, _pos - startpos); 1717string capname = _pattern.Substring(startpos, _pos - startpos); 2198_concatenation!.AddChild(new RegexNode(RegexNodeKind.Multi, _options & ~RegexOptions.IgnoreCase, _pattern.Substring(pos, cch)));
System.Web.HttpUtility (1)
System\Web\Util\UriUtil.cs (1)
20inputWithoutQueryFragment = input.Substring(0, queryFragmentSeparatorPos);
System.Windows.Controls.Ribbon (2)
Microsoft\Windows\Controls\Ribbon\RibbonKeyTipAndContentSyncHelper.cs (1)
155return string.Concat(stringContent.Substring(0, accessorIndex), '_', stringContent.Substring(accessorIndex));
Microsoft\Windows\Controls\TextSearchInternal.cs (1)
329Prefix = prefix.Substring(0, prefix.Length - lastChar.Length);
System.Windows.Forms (5)
System\Windows\Forms\ComponentModel\COM2Interop\COM2IManagedPerPropertyBrowsingHandler.cs (1)
95assemblyName = typeName[comma..];
System\Windows\Forms\Controls\ComboBox\ComboBox.cs (1)
1038get => DropDownStyle == ComboBoxStyle.DropDownList ? string.Empty : Text.Substring(SelectionStart, SelectionLength);
System\Windows\Forms\Controls\Labels\LinkLabel.Link.LinkAccessibleObject.cs (1)
118string? name = text[start..end];
System\Windows\Forms\Controls\TextBox\TextBoxBase.cs (2)
618string line = text[lineStart..lineEnd]; 1246return Text.Substring(selStart, selLength);
System.Windows.Forms.Analyzers.CSharp (3)
System\Windows\Forms\CSharp\Generators\ApplicationConfiguration\ProjectFileReader.FontConverter.cs (3)
47fontName = font.Substring(0, nameIndex); 61sizeStr = font.Substring(nameIndex + 1, styleIndex - nameIndex - 1); 160size = text.Substring(0, splitPoint);
System.Windows.Forms.Design (2)
System\ComponentModel\Design\Serialization\CodeDomComponentSerializationService.CodeDomSerializationStore.ComponentListCodeDomSerializer.cs (1)
224? name.Substring(prevIndex + 1, curIndex)
System\Windows\Forms\Design\ToolStripDesignerUtils.cs (1)
182return currentName[TOOLSTRIPCHARCOUNT..];
System.Windows.Forms.Primitives (4)
System\Windows\Forms\Automation\UiaTextRange.cs (4)
441? new(text[Start..]) 442: new(text.Substring(Start, maxLength)); 791&& (text.Substring(lineStartIndex, lineTextLength) == Environment.NewLine 805if (string.IsNullOrWhiteSpace(text.Substring(lineStartIndex, lineTextLength)))
System.Xaml (10)
src\wpf\src\Microsoft.DotNet.Wpf\src\Shared\System\Windows\Markup\XmlCompatibilityReader.cs (2)
970string prefix = pair.Substring(0, colonIndex); 971string elementName = pair.Substring(colonIndex + 1, length - 1 - colonIndex);
System\Windows\Markup\StaticExtension.cs (2)
72string typeString = _member.Substring(0, dotIndex); 91fieldString = _member.Substring(dotIndex + 1, _member.Length - dotIndex - 1);
System\Xaml\Parser\GenericTypeNameScanner.cs (1)
330string result = _inputText.Substring(_multiCharTokenStartIdx, _multiCharTokenLength);
System\Xaml\Parser\XamlPropertyName.cs (1)
45owner = dottedName.Substring(start, dotIdx);
System\Xaml\Parser\XamlQualifiedName.cs (1)
81prefix = longName.Substring(start, colonIdx);
System\Xaml\Schema\ClrNamespaceUriParser.cs (1)
49clrNs = uriInput.Substring(clrNsStartIdx, clrnsLength);
System\Xaml\Schema\TypeReflector.cs (1)
970name = mi.Name.Substring(KnownStrings.Add.Length,
System\Xaml\XamlXmlWriter.cs (1)
670typeName = type.Name.Substring(0, type.Name.Length - "Extension".Length);
TestingAppHost1.AppHost (2)
TestingAppHostEntryPointProbe.cs (2)
35var id = argument[ArgumentPrefix.Length..]; 68var id = argument[BreakpointArgumentPrefix.Length..];
TypeScriptApiCompat (1)
AtsSurfaceParser.cs (1)
259? symbolId["enum:".Length..]
UIAutomationClient (2)
System\Windows\Automation\Automation.cs (2)
93return full.Substring(0, full.Length - 8); // Slice away "Property" suffix 106return full.Substring(0, full.Length - 26); // Slice away "InvokePatternIdentifiers.Pattern" to get just "Invoke"
UIAutomationClientSideProviders (12)
MS\Internal\AutomationProxies\Accessible.cs (1)
1455return bstr.Substring(0, nulIndex);
MS\Internal\AutomationProxies\WindowsEditBoxRange.cs (2)
200rangeText = rangeText.Substring(Start, Length); 295return text.Substring(Start, maxLength >= 0 ? Math.Min(Length, maxLength) : Length);
MS\Internal\AutomationProxies\WindowsListBox.cs (1)
741text = text.Substring(0, iPos);
MS\Internal\AutomationProxies\WindowsListViewItemCheckBox.cs (1)
110return name.Length < Misc.MaxLengthNameProperty ? name : name.Substring(0, Misc.MaxLengthNameProperty);
MS\Internal\AutomationProxies\WindowsListViewSubItem.cs (1)
199return name.Length < Misc.MaxLengthNameProperty ? name : name.Substring(0, Misc.MaxLengthNameProperty);
MS\Internal\AutomationProxies\WindowsMenu.cs (6)
1313return menuRawText.Substring(0, pos); 1335return menuRawText.Substring(0, SkipMenuSpaceChar(menuText, pos)); 1345return menuRawText.Substring(0, SkipMenuSpaceChar(menuText, pos)); 1363return menuRawText.Substring(0, SkipMenuSpaceChar(menuText, pos)); 2449return string.Format(CultureInfo.CurrentCulture, "{0}{1}{2}", sCanonicalsKeyword, menuText.Substring(pos + cKeyChars + 1, cMenuChars - (pos + cKeyChars + 2)), Char.ToUpper(menuText[cMenuChars - 1], CultureInfo.InvariantCulture)); 2455return string.Concat(sCanonicalsKeyword, menuRawText.Substring(pos + cKeyChars + 1, cMenuChars - (pos + cKeyChars + 1)));
vstest.console (8)
CommandLine\AssemblyMetadataProvider.cs (1)
165result = result.Substring(fxStartIndex, fxEndIndex - 3);
CommandLine\CommandArgumentPair.cs (1)
75Command = input.Substring(0, index);
CommandLine\Executor.cs (1)
473assemblyVersion = Product.Version?.Substring(0, end.Value);
Internal\FilePatternParser.cs (2)
100var pathBeforeWildCard = filePattern.Substring(0, splitOnWildCardIndex); 119string searchDir = filePattern.Substring(0, directorySeparatorIndex);
Internal\ProgressIndicator.cs (1)
55ConsoleOutput.Write(_testRunProgressString.Substring(0, _testRunProgressString.Length + _dotCounter - 2), OutputLevel.Information);
Processors\CLIRunSettingsArgumentProcessor.cs (1)
198var key = arg.Substring(0, indexOfSeparator).Trim();
Processors\EnvironmentArgumentProcessor.cs (1)
104key = key.Substring(0, key.IndexOf("=", StringComparison.Ordinal));
vstest.console.arm64 (8)
src\vstest\src\vstest.console\CommandLine\AssemblyMetadataProvider.cs (1)
165result = result.Substring(fxStartIndex, fxEndIndex - 3);
src\vstest\src\vstest.console\CommandLine\CommandArgumentPair.cs (1)
75Command = input.Substring(0, index);
src\vstest\src\vstest.console\CommandLine\Executor.cs (1)
473assemblyVersion = Product.Version?.Substring(0, end.Value);
src\vstest\src\vstest.console\Internal\FilePatternParser.cs (2)
100var pathBeforeWildCard = filePattern.Substring(0, splitOnWildCardIndex); 119string searchDir = filePattern.Substring(0, directorySeparatorIndex);
src\vstest\src\vstest.console\Internal\ProgressIndicator.cs (1)
55ConsoleOutput.Write(_testRunProgressString.Substring(0, _testRunProgressString.Length + _dotCounter - 2), OutputLevel.Information);
src\vstest\src\vstest.console\Processors\CLIRunSettingsArgumentProcessor.cs (1)
198var key = arg.Substring(0, indexOfSeparator).Trim();
src\vstest\src\vstest.console\Processors\EnvironmentArgumentProcessor.cs (1)
104key = key.Substring(0, key.IndexOf("=", StringComparison.Ordinal));