1912 references to Substring
Aspire.Azure.Messaging.ServiceBus (1)
AzureMessagingServiceBusSettings.cs (1)
148QueueOrTopicName = entityPath.Substring(0, subscriptionsIndex);
Aspire.Dashboard (8)
ConsoleLogs\AnsiParser.cs (6)
39outputBuilder.Append(text[lastWritePos..]); 53outputBuilder.Append(text[lastWritePos..nextEscapeIndex]); 98outputBuilder.Append(text[textStartIndex..(textStartIndex + textLength)]); 118outputBuilder.Append(text[textStartIndex..(textStartIndex + textLength)]); 141outputBuilder.Append(text[textStartIndex..(textStartIndex + textLength)]); 190outputBuilder.Append(text[textStartIndex..(textStartIndex + textLength)]);
ConsoleLogs\UrlParser.cs (1)
36var url = text[urlStart..nextCharIndex];
Otlp\Storage\ApplicationKey.cs (1)
16return new ApplicationKey(Name: name.Substring(0, separator), InstanceId: name.Substring(separator + 1));
Aspire.Dashboard.Components.Tests (1)
tests\Shared\Logging\XunitLoggerProvider.cs (1)
98message = message.Substring(0, message.Length - Environment.NewLine.Length);
Aspire.Dashboard.Tests (1)
tests\Shared\Logging\XunitLoggerProvider.cs (1)
98message = message.Substring(0, message.Length - Environment.NewLine.Length);
Aspire.Hosting (3)
ContainerResourceBuilderExtensions.cs (1)
290var digest = parsedReference.Digest[prefix.Length..];
Dashboard\DashboardLifecycleHook.cs (1)
462category["Aspire.Dashboard.".Length..] : category;
Dcp\DcpNameGenerator.cs (1)
69_ => _configuration["AppHost:Sha256"]!.Substring(0, RandomNameSuffixLength).ToLowerInvariant(),
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)
32.GetCustomAttribute<TargetFrameworkAttribute>()!.FrameworkName[".NETCoreApp,Version=v".Length..];
Aspire.Hosting.Testing (2)
DistributedApplicationFactory.cs (2)
303SetDefault(key["DOTNET_".Length..], value); 309SetDefault(key["ASPNETCORE_".Length..], value);
Aspire.Hosting.Testing.Tests (1)
tests\Shared\Logging\XunitLoggerProvider.cs (1)
98message = message.Substring(0, message.Length - Environment.NewLine.Length);
Aspire.Hosting.Tests (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);
BoundTreeGenerator (5)
BoundNodeClassWriter.cs (5)
1706elementType = typeName[immutableArrayPrefix.Length..^1]; 1743return typeName.Substring(0, iStart); 1753return typeName.Substring(0, iStart); 1773var sub = typeName.Substring(iStart + 1, iEnd - iStart - 1); 1787var sub = typeName.Substring(iStart + 3, iEnd - iStart - 3).Trim();
BuildActionTelemetryTable (1)
Program.cs (1)
301part = part.Substring(0, part.LastIndexOf(suffix));
BuildBoss (1)
SolutionUtil.cs (1)
73return line.Substring(start, end - start);
ClientSample (2)
src\Shared\CommandLineUtils\CommandLine\AnsiConsole.cs (1)
84var text = message.Substring(escapeScan, escapeIndex - escapeScan);
src\Shared\CommandLineUtils\CommandLine\CommandOption.cs (1)
40ValueName = part.Substring(1, part.Length - 2);
Crossgen2Tasks (2)
CommonFilePulledFromSdkRepo\Logger.cs (1)
97code = format.Substring(0, 10);
ResolveReadyToRunCompilers.cs (1)
243platform = runtimeIdentifier.Substring(0, separator).ToLowerInvariant();
CSharpErrorFactsGenerator (4)
Program.cs (4)
46warningCodeNames.Add(line.Substring(0, line.IndexOf(' '))); 50fatalCodeNames.Add(line.Substring(0, line.IndexOf(' '))); 54infoCodeNames.Add(line.Substring(0, line.IndexOf(' '))); 58hiddenCodeNames.Add(line.Substring(0, line.IndexOf(' ')));
CSharpSyntaxGenerator (2)
AbstractFileWriter.cs (2)
210var sub = typeName.Substring(iStart + 1, iEnd - iStart - 1); 284? name.Substring(0, name.Length - post.Length)
DesignSurfaceExt (1)
NameCreationServiceImp.cs (1)
40value = int.Parse(name[type.Name.Length..]);
dotnet-dev-certs (3)
src\Shared\CertificateGeneration\UnixCertificateManager.cs (1)
341? Path.Combine("$HOME", certDir[homeDirectoryWithSlash.Length..])
src\Shared\CommandLineUtils\CommandLine\AnsiConsole.cs (1)
84var text = message.Substring(escapeScan, escapeIndex - escapeScan);
src\Shared\CommandLineUtils\CommandLine\CommandOption.cs (1)
40ValueName = part.Substring(1, part.Length - 2);
dotnet-getdocument (2)
src\Shared\CommandLineUtils\CommandLine\AnsiConsole.cs (1)
84var text = message.Substring(escapeScan, escapeIndex - escapeScan);
src\Shared\CommandLineUtils\CommandLine\CommandOption.cs (1)
40ValueName = part.Substring(1, part.Length - 2);
dotnet-openapi (2)
src\Shared\CommandLineUtils\CommandLine\AnsiConsole.cs (1)
84var text = message.Substring(escapeScan, escapeIndex - escapeScan);
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-sql-cache (2)
src\Shared\CommandLineUtils\CommandLine\AnsiConsole.cs (1)
84var text = message.Substring(escapeScan, escapeIndex - escapeScan);
src\Shared\CommandLineUtils\CommandLine\CommandOption.cs (1)
40ValueName = part.Substring(1, part.Length - 2);
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-svcutil-lib (93)
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\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-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\Shared\CommandLineUtils\CommandLine\AnsiConsole.cs (1)
84var text = message.Substring(escapeScan, escapeIndex - escapeScan);
src\Shared\CommandLineUtils\CommandLine\CommandOption.cs (1)
40ValueName = part.Substring(1, part.Length - 2);
dotnet-user-secrets (2)
src\Shared\CommandLineUtils\CommandLine\AnsiConsole.cs (1)
84var text = message.Substring(escapeScan, escapeIndex - escapeScan);
src\Shared\CommandLineUtils\CommandLine\CommandOption.cs (1)
40ValueName = part.Substring(1, part.Length - 2);
GenerateDocumentationAndConfigFiles (1)
src\RoslynAnalyzers\Microsoft.CodeAnalysis.Analyzers\Core\MetaAnalyzers\ReleaseTrackingHelper.cs (1)
76string versionString = lineText[ReleasePrefix.Length..].Trim();
GetDocument.Insider (3)
src\Shared\CommandLineUtils\CommandLine\AnsiConsole.cs (2)
84var text = message.Substring(escapeScan, escapeIndex - escapeScan); 96if (int.TryParse(message.Substring(startIndex, endIndex - startIndex), out value))
src\Shared\CommandLineUtils\CommandLine\CommandOption.cs (1)
40ValueName = part.Substring(1, part.Length - 2);
HttpStress (3)
Program.cs (3)
459await context.Response.WriteAsync(contentSource.Substring(0, contentSource.Length / 2)); 465var writeTask = context.Response.WriteAsync(contentSource.Substring(0, contentSource.Length)); 655return input.Substring(offset, length);
IIS.FunctionalTests (2)
src\Servers\IIS\IIS\test\Common.FunctionalTests\RequestPathBaseTests.cs (1)
95var status = int.Parse(headers[0].Substring(9, 3), CultureInfo.InvariantCulture);
src\Servers\IIS\IIS\test\Common.FunctionalTests\RequestResponseTests.cs (1)
802var status = int.Parse(headers[0].Substring(9, 3), CultureInfo.InvariantCulture);
IIS.LongTests (2)
src\Servers\IIS\IIS\test\Common.LongTests\StartupTests.cs (2)
90var dotnetLocationWithoutExtension = _dotnetLocation.Substring(0, _dotnetLocation.LastIndexOf(".", StringComparison.Ordinal)); 101var dotnetLocationWithoutExtension = _dotnetLocation.Substring(0, _dotnetLocation.LastIndexOf(".", StringComparison.Ordinal)).ToUpperInvariant();
IIS.NewHandler.FunctionalTests (2)
src\Servers\IIS\IIS\test\Common.LongTests\StartupTests.cs (2)
90var dotnetLocationWithoutExtension = _dotnetLocation.Substring(0, _dotnetLocation.LastIndexOf(".", StringComparison.Ordinal)); 101var dotnetLocationWithoutExtension = _dotnetLocation.Substring(0, _dotnetLocation.LastIndexOf(".", StringComparison.Ordinal)).ToUpperInvariant();
IIS.NewShim.FunctionalTests (2)
src\Servers\IIS\IIS\test\Common.LongTests\StartupTests.cs (2)
90var dotnetLocationWithoutExtension = _dotnetLocation.Substring(0, _dotnetLocation.LastIndexOf(".", StringComparison.Ordinal)); 101var dotnetLocationWithoutExtension = _dotnetLocation.Substring(0, _dotnetLocation.LastIndexOf(".", StringComparison.Ordinal)).ToUpperInvariant();
IISExpress.FunctionalTests (4)
src\Servers\IIS\IIS\test\Common.FunctionalTests\RequestPathBaseTests.cs (1)
95var status = int.Parse(headers[0].Substring(9, 3), CultureInfo.InvariantCulture);
src\Servers\IIS\IIS\test\Common.FunctionalTests\RequestResponseTests.cs (1)
802var status = int.Parse(headers[0].Substring(9, 3), CultureInfo.InvariantCulture);
src\Servers\IIS\IIS\test\Common.LongTests\StartupTests.cs (2)
90var dotnetLocationWithoutExtension = _dotnetLocation.Substring(0, _dotnetLocation.LastIndexOf(".", StringComparison.Ordinal)); 101var dotnetLocationWithoutExtension = _dotnetLocation.Substring(0, _dotnetLocation.LastIndexOf(".", StringComparison.Ordinal)).ToUpperInvariant();
illink (15)
ILLink.RoslynAnalyzer (1)
TrimAnalysis\ParameterProxy.cs (1)
58 public partial bool IsTypeOf (string typeName) => ParameterType.IsTypeOf (typeName.Substring (0, typeName.LastIndexOf ('.')), typeName.Substring (1 + typeName.LastIndexOf ('.')));
ILLink.Tasks (4)
CreateRuntimeRootDescriptorFile.cs (4)
160 string lhs = namespaceDefElements[1].Substring (startIndex, namespaceDefElements[1].LastIndexOf ('N') - startIndex); 168 string prefix = namespaceDefElements[2].Substring (startIndex, namespaceDefElements[2].LastIndexOf ('N') - startIndex); 463 classNamespace = classNamespace.Substring (0, classNamespace.Length - suffixToRemove.Length); 526 defineName = defineName.Substring (0, commentIndex);
Infrastructure.Common (1)
JsonSerializer.cs (1)
43string key = pair.Substring(0, colonPos - 1).Replace("\"", String.Empty).Trim();
InMemory.FunctionalTests (4)
ResponseTests.cs (1)
4973return (HttpStatusCode)int.Parse(response.Substring(statusStart, statusLength), CultureInfo.InvariantCulture);
src\Servers\Kestrel\shared\test\CertHelper.cs (1)
180var name = testMethodName.Length > 63 ? testMethodName.Substring(0, 63) : testMethodName;
src\Servers\Kestrel\shared\test\StringExtensions.cs (1)
15return s.Substring(0, Math.Min(128, s.Length))
TestTransport\InMemoryHttpClientSlim.cs (1)
117return (HttpStatusCode)int.Parse(response.Substring(statusStart, statusLength), CultureInfo.InvariantCulture);
InProcessWebSite (1)
src\Servers\IIS\IIS\test\testassets\InProcessWebSite\Startup.WebSockets.cs (1)
174Encoding.ASCII.GetString(buffer).Substring(0, result.Count) == closeFromServerCmd)
installer.tasks (2)
RegenerateDownloadTable.cs (1)
67.Select(line => line.Substring(
StaticFileRegeneration\RegenerateThirdPartyNotices.cs (1)
133$"Existing TPN file preamble: {existingTpn.Preamble.Substring(0, 10)}...");
Interop.FunctionalTests (2)
H2SpecCommands.cs (2)
182section = line.Substring(0, firstSpace - 1); // Drop the trailing dot. 205testNumber = line.Substring(0, firstSpace - 1); // Drop the trailing colon.
InteropClient (1)
InteropClient.cs (1)
896return Convert.FromBase64String(pemString.Substring(start, end));
IOperationGenerator (1)
IOperationClassWriter.cs (1)
1112arrayType = typeName[ImmutableArrayPrefix.Length..^1];
Metrics (1)
src\RoslynAnalyzers\Utilities\Compiler\WellKnownTypeProvider.cs (1)
222namespaceNamesBuilder.Add(fullTypeName[prevStartIndex..i]);
Metrics.Legacy (1)
src\RoslynAnalyzers\Utilities\Compiler\WellKnownTypeProvider.cs (1)
222namespaceNamesBuilder.Add(fullTypeName[prevStartIndex..i]);
Microsoft.Analyzers.Extra (1)
CallAnalysis\Fixers\LegacyLoggingFixer.FixDetails.cs (1)
281args.Add(message.Substring(openBraceIndex + 1, formatDelimiterIndex - openBraceIndex - 1));
Microsoft.Analyzers.Local (4)
ApiLifecycle\Utils.cs (4)
40return type.Substring(0, whereClauseIndex).Trim(); 63var substring = substrings[1].Substring(0, substrings[1].IndexOf(" where ", StringComparison.Ordinal)); 88results.Add(baseTypesString.Substring(start, i - start).Trim()); 93results.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.Analyzer.Testing (2)
TestSource.cs (2)
38var markerName = line.Substring(markerStartIndex + 2, markerEndIndex - markerStartIndex - 2); 46line = line.Substring(0, markerStartIndex) + line.Substring(markerEndIndex + MarkerEnd.Length);
Microsoft.AspNetCore.App.Analyzers (2)
src\Shared\RoslynUtils\WellKnownTypes.cs (2)
42name = name.Substring(0, separator); 43typeIdName = typeIdName.Substring(0, separator);
Microsoft.AspNetCore.App.Analyzers.Test (6)
RouteEmbeddedLanguage\Infrastructure\MarkupTestFile.cs (2)
114outputBuilder.Append(input.Substring(currentIndexInInput, matchIndexInInput - currentIndexInInput)); 119switch (matchString.Substring(0, 2))
RouteEmbeddedLanguage\RoutePatternClassifierTests.cs (1)
33var actualFormatted = actualOrdered.Select(a => new FormattedClassification(rewrittenCode.Substring(a.TextSpan.Start, a.TextSpan.Length), a.ClassificationType)).ToArray();
RouteEmbeddedLanguage\RoutePatternParserTests.cs (3)
88current = current.Substring(0, current.Length - 2) + "\""; 111stringText.Substring(0, start) + 112stringText.Substring(start + 1, stringText.Length - (start + 1)),
Microsoft.AspNetCore.App.UnitTests (4)
SharedFxTests.cs (1)
283? fileName.Substring(0, fileName.Length - 4)
TargetingPackTests.cs (3)
234? fileName.Substring(0, fileName.Length - 4) 254? fileName.Substring(0, fileName.Length - 4) 328? fileName.Substring(0, fileName.Length - 4)
Microsoft.AspNetCore.Authentication.Cookies (1)
src\Shared\ChunkingCookieManager\ChunkingCookieManager.cs (1)
207var segment = value.Substring(offset, length);
Microsoft.AspNetCore.Authentication.Negotiate (1)
Internal\LdapAdapter.cs (1)
24var userAccountName = userAccountNameIndex == -1 ? user : user.Substring(0, userAccountNameIndex);
Microsoft.AspNetCore.Authentication.OpenIdConnect (1)
OpenIdConnectHandler.cs (1)
1186var nonceDecodedValue = Options.StringDataFormat.Unprotect(nonceKey.Substring(Options.NonceCookie.Name.Length, nonceKey.Length - Options.NonceCookie.Name.Length));
Microsoft.AspNetCore.Authentication.Test (6)
FacebookTests.cs (1)
443nonceCookie = nonceCookie.Substring(0, nonceCookie.IndexOf(';'));
GoogleTests.cs (1)
1076nonceCookie = nonceCookie.Substring(0, nonceCookie.IndexOf(';'));
MicrosoftAccountTests.cs (1)
343nonceCookie = nonceCookie.Substring(0, nonceCookie.IndexOf(';'));
OpenIdConnect\OpenIdConnectTests.cs (1)
578timestamp = timestamp.Substring(0, endOfTimestamp);
OpenIdConnect\TestTransaction.cs (1)
30return authCookie.Substring(0, authCookie.IndexOf(';'));
Transaction.cs (1)
28return authCookie.Substring(0, authCookie.IndexOf(';'));
Microsoft.AspNetCore.Components (19)
NavigationManager.cs (1)
324baseUri = baseUri.Substring(0, lastSlashIndex + 1);
src\Http\Routing\src\ParameterPolicyActivator.cs (2)
81policyKey = inlineParameterPolicy.Substring(0, indexOfFirstOpenParens); 82argumentString = inlineParameterPolicy.Substring(
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\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.WebView.Maui (1)
src\BlazorWebView\src\SharedSource\QueryStringHelper.cs (1)
21 : url.Substring(0, indexOfQueryString);
Microsoft.AspNetCore.Components.WebView.Test (1)
Infrastructure\TestDocument.cs (1)
327var firstTwoChars = attributeName.Substring(0, 2);
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.CookiePolicy.Test (2)
src\Shared\ChunkingCookieManager\ChunkingCookieManager.cs (1)
207var segment = value.Substring(offset, length);
Transaction.cs (1)
29return authCookie.Substring(0, authCookie.IndexOf(';'));
Microsoft.AspNetCore.DataProtection (1)
TypeForwardingActivator.cs (1)
89return forwardedTypeName.Substring(0, versionStartIndex);
Microsoft.AspNetCore.DataProtection.Tests (1)
Repositories\FileSystemXmlRepositoryTests.cs (1)
111var filenameNoSuffix = filename.Substring(0, filename.Length - ".xml".Length);
Microsoft.AspNetCore.DeveloperCertificates.XPlat (1)
src\Shared\CertificateGeneration\UnixCertificateManager.cs (1)
341? Path.Combine("$HOME", certDir[homeDirectoryWithSlash.Length..])
Microsoft.AspNetCore.Grpc.JsonTranscoding (2)
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)
290remaining = new PathString(value1[value2.Length..]); 340matched = new PathString(value1.Substring(0, value2.Length)); 341remaining = 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\Shared\RoslynUtils\WellKnownTypes.cs (2)
42name = name.Substring(0, separator); 43typeIdName = typeIdName.Substring(0, separator);
Microsoft.AspNetCore.Http.ValidationsGenerator (2)
src\Shared\RoslynUtils\WellKnownTypes.cs (2)
42name = name.Substring(0, separator); 43typeIdName = typeIdName.Substring(0, separator);
Microsoft.AspNetCore.HttpLogging.Tests (5)
HttpLoggingMiddlewareTests.cs (5)
425var expected = input.Substring(0, options.CurrentValue.RequestBodyLogLimit / 3) + "[Truncated by RequestBodyLogLimit]"; 461var expected = input.Substring(0, options.CurrentValue.RequestBodyLogLimit) + "[Truncated by RequestBodyLogLimit]"; 486var expected = input.Substring(0, 4096) + "[Only partially consumed by app]"; 512var expected = input.Substring(0, 4096) + "[Only partially consumed by app]"; 1080var expected = input.Substring(0, options.CurrentValue.ResponseBodyLogLimit);
Microsoft.AspNetCore.InternalTesting (2)
HttpClientSlim.cs (1)
144return (HttpStatusCode)int.Parse(response.Substring(statusStart, statusLength), CultureInfo.InvariantCulture);
Logging\XunitLoggerProvider.cs (1)
100message = message.Substring(0, message.Length - Environment.NewLine.Length);
Microsoft.AspNetCore.InternalTesting.Tests (4)
AssemblyTestLogTests.cs (4)
305longTestName.Substring(0, testFileName.Length / 2), 306testFileName.Substring(0, testFileName.Length / 2)); 310longTestName.Substring(longTestName.Length - testFileName.Length / 2, testFileName.Length / 2), 311testFileName.Substring(testFileName.Length - testFileName.Length / 2, testFileName.Length / 2));
Microsoft.AspNetCore.Mvc.ApiExplorer (1)
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\Shared\ChunkingCookieManager\ChunkingCookieManager.cs (1)
207var segment = value.Substring(offset, length);
Microsoft.AspNetCore.Mvc.Core.Test (1)
ModelBinding\Validation\DefaultComplexObjectValidationStrategyTest.cs (1)
221public string Name => _string.Substring(3, 5);
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\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.Razor.RuntimeCompilation.Test (2)
TestInfrastructure\DirectoryNode.cs (2)
105return path.Substring(0, fileNameIndex + 1); 128var directoryPath = path.Substring(0, index + 1); // + 1 to include trailing slash
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)
224var xNoExt = xExtIndex >= 0 ? x.Substring(0, xExtIndex) : x; 225var 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.TagHelpers.Test (7)
JavaScriptResourcesTest.cs (3)
16var expected = resource.Substring(0, resource.Length - 2); 33var expected = resource.Substring(0, resource.Length - 2); 78var expected = resource.Substring(0, resource.Length - 2);
PersistComponentStateTagHelperTest.cs (4)
101var message = content["<!--Blazor-WebAssembly-Component-State:".Length..^"-->".Length]; 131var message = content["<!--Blazor-WebAssembly-Component-State:".Length..^"-->".Length]; 161var payload = content["<!--Blazor-Server-Component-State:".Length..^"-->".Length]; 214var payload = content["<!--Blazor-Server-Component-State:".Length..^"-->".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 (1)
src\Shared\RoslynUtils\TypeHelper.cs (1)
53originalName = generatedName.Substring(startIndex + 4, endIndex - startIndex - 4);
Microsoft.AspNetCore.OpenApi.SourceGenerators (1)
XmlComments\XmlComment.cs (1)
31xml = xml.Substring(5, xml.Length - 11);
Microsoft.AspNetCore.ResponseCompression (1)
ResponseCompressionProvider.cs (1)
200mimeType = 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)
64scheme = newPath.Substring(0, schemeSplit); 75host = new HostString(newPath.Substring(schemeSplit, pathSplit - schemeSplit)); 91resolvedPath = newPath.Substring(0, querySplit);
RewriteRule.cs (1)
73var newPath = result.Substring(0, split);
UrlActions\RedirectAction.cs (1)
64response.Headers.Location = pathBase + pattern.Substring(0, split) + query;
UrlActions\RewriteAction.cs (1)
95var 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\Shared\RoslynUtils\TypeHelper.cs (1)
53originalName = generatedName.Substring(startIndex + 4, endIndex - startIndex - 4);
Microsoft.AspNetCore.Routing.Microbenchmarks (2)
Matching\JumpTableMultipleEntryBenchmark.cs (2)
44entries.Add((_strings[sampleIndex].Substring(segment.Start, segment.Length), i)); 158var text = guid.Substring(0, Math.Max(5, Math.Min(i, 36)));
Microsoft.AspNetCore.Routing.Tests (4)
Matching\ILEmitTrieJumpTableTest.cs (3)
85Assert.Equal(entry, path.Substring(start, length), ignoreCase: true); 146Assert.Equal(entry, path.Substring(start, length), ignoreCase: true); 210Assert.NotEqual(entry, path.Substring(start, length));
Template\TemplateBinderTests.cs (1)
1450Path = uri.Substring(0, queryIndex);
Microsoft.AspNetCore.Server.HttpSys (9)
RequestProcessing\Request.cs (3)
98Path = originalPath[pathBase.Length..]; 104Path = originalPath[pathBase.Length..]; 159Path = originalPath[originalOffset..];
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.HttpSys.FunctionalTests (4)
RequestHeaderTests.cs (4)
79var responseStatusCode = result.Substring(9, 3); // Skip "HTTP/1.1 " 120var responseStatusCode = response.Substring(9, 3); // Skip "HTTP/1.1 " 143var responseStatusCode = response.Substring(9, 3); // Skip "HTTP/1.1 " 175var responseStatusCode = response.Substring(9, 3); // Skip "HTTP/1.1 "
Microsoft.AspNetCore.Server.IIS (3)
Core\IISHttpContext.cs (1)
265Path = originalPath[originalOffset..];
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\Shared\CertificateGeneration\UnixCertificateManager.cs (1)
341? Path.Combine("$HOME", certDir[homeDirectoryWithSlash.Length..])
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (2)
src\Servers\Kestrel\shared\test\CertHelper.cs (1)
180var name = testMethodName.Length > 63 ? testMethodName.Substring(0, 63) : testMethodName;
src\Servers\Kestrel\shared\test\StringExtensions.cs (1)
15return s.Substring(0, Math.Min(128, s.Length))
Microsoft.AspNetCore.Shared.Tests (4)
src\Shared\CommandLineUtils\CommandLine\AnsiConsole.cs (1)
84var text = message.Substring(escapeScan, escapeIndex - escapeScan);
src\Shared\CommandLineUtils\CommandLine\CommandOption.cs (1)
40ValueName = part.Substring(1, part.Length - 2);
src\Shared\HttpSys\RequestProcessing\HeaderParser.cs (2)
36var subValue = value.Substring(start, current - start); 47var subValue = value.Substring(start, current - start);
Microsoft.AspNetCore.SignalR.Tests.Utils (1)
ExceptionMessageExtensions.cs (1)
20return message.Substring(0, lastNewline);
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.AspNetCore.WebUtilities.Tests (4)
HttpRequestStreamReaderTest.cs (4)
158Assert.Equal(valueString.Substring(0, valueString.IndexOf('\r')), data); 161Assert.Equal(valueString.Substring(valueString.IndexOf('\r') + 1, 3), data); 164Assert.Equal(valueString.Substring(valueString.IndexOf('\n') + 1, 2), data); 184Assert.Equal(valueString.Substring(1, valueString.IndexOf('\r') - 1), data);
Microsoft.Build (67)
AssemblyNameExtension.cs (2)
592string nameThis = asString1.Substring(0, baseLenThis); 593string nameThat = asString2.Substring(0, baseLenThat);
CanonicalError.cs (1)
302message = message.Substring(0, 400);
Construction\Solution\SolutionFile.cs (3)
1370string configurationName = propertyName.Substring(0, indexOfFirstDot); 1453string referencedProjectGuid = projectReferenceEntry.Substring(indexOfOpeningBrace, 1483return property.Substring(1, property.Length - 2);
Construction\Solution\SolutionProjectGenerator.cs (4)
543string projectGuid = proj.ProjectGuid.Substring(1, proj.ProjectGuid.Length - 2); 1026escapedSolutionFileName = escapedSolutionFileName.Substring(0, escapedSolutionFileName.Length - 1); 1718aspNetPhysicalPath = aspNetPhysicalPath.Substring(0, aspNetPhysicalPath.Length - 1); 2188referencedWebProjectGuid = referencedWebProjectGuid.Substring(0, 38);
Definition\Project.cs (2)
2983string displayValue = escapedValue.Substring(0, Math.Min(escapedValue.Length, 75)) + ((escapedValue.Length > 75) ? "..." : String.Empty); 2990string displayOriginalValue = originalValue.Substring(0, Math.Min(originalValue.Length, 75)) + ((originalValue.Length > 75) ? "..." : String.Empty);
Definition\ProjectCollection.cs (1)
493: fullInformationalVersion.Substring(startIndex: 0, length: plusIndex + 10);
Definition\Toolset.cs (1)
433toolsPathToUse = 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)
78rightValueExpandedPiece = rightValueExpanded.Substring(0, indexOfVerticalBar);
Evaluation\Expander.cs (11)
981string subExpressionToReplaceIn = expression.Substring(start, itemVectorExpressions[n].Index - start); 1111$"{metadataValue.Substring(0, CharacterLimitPerExpansion - 3)}..."; 1267propertyBody = expression.Substring(propertyStartIndex + 2, propertyEndIndex - propertyStartIndex - 2); 1291propertyBody = expression.Substring(propertyStartIndex + 2, propertyEndIndex - propertyStartIndex - 2); 1319$"{value.Substring(0, CharacterLimitPerExpansion - 3)}..."; 1574propertyValue = ExpandMSBuildThisFileProperty(propertyName.Substring(startIndex, endIndex - startIndex + 1), elementLocation); 1685string registryKeyName = lastAtSignOffset != -1 ? registryLocation.Substring(0, lastAtSignOffset) : registryLocation; 3856string candidateAssemblyName = baseName.Substring(0, assemblyNameEnd); 3922string argumentsContent = expressionFunction.Substring(1, indexerEndIndex - 1); 4009string argumentsContent = expressionFunction.Substring(argumentStartIndex, argumentsEndIndex - argumentStartIndex); 4168parameters = parameters.Substring(0, parameters.Length - 2);
Evaluation\Expander\WellKnownFunctions.cs (1)
281returnVal = text.Substring(startIndex, length);
Evaluation\ExpressionShredder.cs (7)
180transformExpressions.Add(new ItemExpressionCapture(startQuoted, endQuoted - startQuoted, expression.Substring(startQuoted, endQuoted - startQuoted))); 230separator = expression.Substring(i, closingQuote - i); 305string name = expression.Substring(startOfName, i - startOfName); 408string firstPart = expression.Substring(startOfText, i - startOfText); 430metadataName = expression.Substring(startOfText, i - startOfText); 596ItemExpressionCapture capture = new ItemExpressionCapture(startTransform, i - startTransform, expression.Substring(startTransform, i - startTransform)); 597capture.FunctionName = expression.Substring(startTransform, endFunctionName - startTransform);
Evaluation\IntrinsicFunctions.cs (1)
761basekeyName = 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);
FileMatcher.cs (7)
628fixedDirectoryPart = filespec.Substring(0, indexOfLastDirectorySeparator + 1); 637string filespecLeftOfWildcard = filespec.Substring(0, indexOfFirstWildcard); 651wildcardDirectoryPart = filespec.Substring(0, indexOfLastDirectorySeparator + 1); 659fixedDirectoryPart = filespec.Substring(0, indexOfSeparatorBeforeWildCard + 1); 660wildcardDirectoryPart = filespec.Substring(indexOfSeparatorBeforeWildCard + 1, indexOfLastDirectorySeparator - indexOfSeparatorBeforeWildCard); 1130pattern = indexOfNextSlash != -1 ? recursionState.RemainingWildcardDirectory.Substring(0, indexOfNextSlash) : recursionState.RemainingWildcardDirectory; 2123directoryPattern = wildcard.Substring(3, wildcardLength - 6);
FileUtilities.cs (4)
258return FixFilePath(path.Substring(start, stop - start)); 289path = path.Substring(0, path.Length - 1); 338path = $"{targetQuote}{path.Substring(1, path.Length - 2)}{targetQuote}"; 405return FixFilePath(fullPath.Substring(0, i));
FrameworkLocationHelper.cs (1)
819baseLocation.Substring(0, indexOf64) + baseLocation.Substring(indexOf64 + 2);
Globbing\MSBuildGlob.cs (1)
136string fixedDirectoryPart = normalizedInput.Substring(0, fixedDirectoryPartLength);
Logging\LogFormatter.cs (1)
54return rawTime.Substring(0, prettyLength);
Logging\TerminalLogger\TerminalLogger.cs (1)
1192? $"{path.Substring(0, index + 1)}{AnsiCodes.MakeBold(path.Substring(index + 1))}"
MSBuildNameIgnoreCaseComparer.cs (1)
190return StringComparer.OrdinalIgnoreCase.GetHashCode(obj.Substring(start, length));
PrintLineDebuggerWriters.cs (1)
80var artifactsPart = executingAssembly.Substring(0, logIndex);
ResourceUtilities.cs (2)
70code = message.Substring(i, 7); 113code = message.Substring(i, k - i);
StringUtils.cs (2)
38return randomBase64String.Substring(0, length); 59$"{fromString.Substring(0, lastOccurrenceIndex)}{fromString.Substring(lastOccurrenceIndex + substring.Length)}";
Microsoft.Build.Engine.OM.UnitTests (6)
FileUtilities.cs (3)
258return FixFilePath(path.Substring(start, stop - start)); 289path = path.Substring(0, path.Length - 1); 405return FixFilePath(fullPath.Substring(0, i));
PrintLineDebuggerWriters.cs (1)
80var artifactsPart = executingAssembly.Substring(0, logIndex);
ResourceUtilities.cs (2)
70code = message.Substring(i, 7); 113code = message.Substring(i, k - i);
Microsoft.Build.Engine.UnitTests (9)
Definition\ToolsVersion_Tests.cs (1)
963? path.Substring(0, path.Length - 1)
FileMatcher_Tests.cs (7)
2083else if (pattern.Substring(0, 2) == "*.") // Match patterns like *.cs 2093else if (pattern.Substring(pattern.Length - 4, 2) == ".?") // Match patterns like foo.?xt 2095string leader = pattern.Substring(0, pattern.Length - 4); 2096string candidateLeader = candidate.Substring(candidate.Length - leader.Length - 4, leader.Length); 2150: normalizedCandidate.Substring(0, nextSlash); 2152string baseMatch = Path.GetFileName(normalizedCandidate.Substring(0, nextSlash)); 2163pattern.Substring(0, 1) == "?"
FileUtilities_Tests.cs (1)
883var rootLevelPath = SystemSpecificAbsolutePath.Substring(0, secondSlash);
Microsoft.Build.Framework (3)
FileClassifier.cs (2)
147dir = dir.Substring(0, dir.Length - devEnvExeRelativePath.Length); 323path = path.Substring(0, path.Length - 1);
InterningWriteTranslator.cs (1)
146string directory = str.Substring(0, splitId + 1);
Microsoft.Build.Framework.UnitTests (2)
ResourceUtilities.cs (2)
70code = message.Substring(i, 7); 113code = message.Substring(i, k - i);
Microsoft.Build.Tasks.CodeAnalysis (4)
CanonicalError.cs (1)
267message = message.Substring(0, 400);
src\Compilers\Core\Portable\InternalUtilities\CompilerOptionParseUtilities.cs (1)
42string name = feature.Substring(0, equals);
Vbc.cs (2)
351string twoLetterPrefix = originalBaseAddress.Substring(0, 2); 705string? newLine = originalVBErrorString.Substring(0, endParenthesisLocation) + "," + column + originalVBErrorString.Substring(endParenthesisLocation);
Microsoft.Build.Tasks.Core (33)
AssemblyDependency\AssemblyInformation.cs (1)
1167v = v.Substring(0, firstNull);
AssemblyDependency\ReferenceTable.cs (2)
789string name = fusionName.Substring(0, firstComma); 837value = fusionName.Substring(position, nextDelimiter);
BootstrapperUtil\BootstrapperBuilder.cs (3)
329productCodes = productCodes.Substring(0, productCodes.Length - 2); 351productCodes = productCodes.Substring(0, productCodes.Length - 2); 461if (folder.Length >= packagePath.Length && folder.Substring(0, packagePath.Length).ToLowerInvariant().CompareTo(packagePath) == 0)
CanonicalError.cs (1)
302message = message.Substring(0, 400);
CreateManifestResourceName.cs (1)
188conventionDependentUpon = fileNameWithoutExtension.Substring(0, indexJustBeforeCulture) + SourceFileExtension;
FileMatcher.cs (7)
628fixedDirectoryPart = filespec.Substring(0, indexOfLastDirectorySeparator + 1); 637string filespecLeftOfWildcard = filespec.Substring(0, indexOfFirstWildcard); 651wildcardDirectoryPart = filespec.Substring(0, indexOfLastDirectorySeparator + 1); 659fixedDirectoryPart = filespec.Substring(0, indexOfSeparatorBeforeWildCard + 1); 660wildcardDirectoryPart = filespec.Substring(indexOfSeparatorBeforeWildCard + 1, indexOfLastDirectorySeparator - indexOfSeparatorBeforeWildCard); 1130pattern = indexOfNextSlash != -1 ? recursionState.RemainingWildcardDirectory.Substring(0, indexOfNextSlash) : recursionState.RemainingWildcardDirectory; 2123directoryPattern = wildcard.Substring(3, wildcardLength - 6);
FileUtilities.cs (3)
258return FixFilePath(path.Substring(start, stop - start)); 289path = path.Substring(0, path.Length - 1); 405return FixFilePath(fullPath.Substring(0, i));
ManifestUtil\BaseReference.cs (1)
51path = path.Substring(0, path.Length - Constants.DeployFileExtension.Length);
MSBuildNameIgnoreCaseComparer.cs (1)
190return StringComparer.OrdinalIgnoreCase.GetHashCode(obj.Substring(start, length));
PrintLineDebuggerWriters.cs (1)
80var artifactsPart = executingAssembly.Substring(0, logIndex);
RedistList.cs (1)
376return i > 0 ? assemblyName.Substring(0, i) : assemblyName;
ResolveManifestFiles.cs (1)
880string simpleName = fusionName.Substring(0, i); // example: "ClassLibrary1, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" -> "ClassLibrary1"
ResourceHandling\MSBuildResXReader.cs (2)
346fileName = stringValue.Substring(1, lastIndexOfQuote - 1); // remove the quotes in" ..... " 362fileName = stringValue.Substring(0, nextSemiColumn);
ResourceHandling\NameUtilities.cs (1)
26return assemblyQualifiedName.Substring(0, commaIndex);
ResourceUtilities.cs (2)
70code = message.Substring(i, 7); 113code = message.Substring(i, k - i);
System.Design.cs (1)
144args[i] = value.Substring(0, 1024 - 3) + "...";
system.design\stronglytypedresourcebuilder.cs (1)
500commentString = SR.GetString(SR.StringPropertyTruncatedComment, commentString.Substring(0, DocCommentLengthThreshold));
VisualBasictokenEnumerator.cs (1)
170current.InnerText = identifierOrKeyword.Substring(1, identifierOrKeyword.Length - 2);
WriteCodeFragment.cs (2)
316var parameterNameKey = key.Substring(0, key.Length - TypeNameSuffix.Length); 347var parameterNameKey = key.Substring(0, key.Length - IsLiteralSuffix.Length);
Microsoft.Build.Tasks.UnitTests (6)
RARPrecomputedCache_Tests.cs (1)
135rarReaderTask.StateFile = precomputedCache.Path.Substring(0, precomputedCache.Path.Length - 6); // Not a real path; should not be used.
ResourceHandling\GenerateResource_Tests.cs (1)
3775string segment = unformattedMessage.Substring(i, match.Index - i);
Unzip_Tests.cs (2)
466var permissions = ExecuteCommand("ls -l", sourceFile.Path).Substring(0, 10); 482var unzippedFilePermissions = ExecuteCommand("ls -l", unzippedFilePath).Substring(0, 10);
WriteCodeFragment_Tests.cs (2)
382Assert.Equal(Path.GetTempPath(), task.OutputFile.ItemSpec.Substring(0, Path.GetTempPath().Length)); 405Assert.Equal(folder.ItemSpec, task.OutputFile.ItemSpec.Substring(0, folder.ItemSpec.Length));
Microsoft.Build.UnitTests.Shared (2)
ObjectModelHelpers.cs (2)
527string itemSpec = singleExpectedItemStringTrimmed.Substring(0, indexOfColon).Trim(); 543string itemMetadataName = itemMetadataPieceTrimmed.Substring(0, indexOfEquals).Trim();
Microsoft.Build.Utilities.Core (17)
CanonicalError.cs (1)
302message = message.Substring(0, 400);
FileMatcher.cs (7)
628fixedDirectoryPart = filespec.Substring(0, indexOfLastDirectorySeparator + 1); 637string filespecLeftOfWildcard = filespec.Substring(0, indexOfFirstWildcard); 651wildcardDirectoryPart = filespec.Substring(0, indexOfLastDirectorySeparator + 1); 659fixedDirectoryPart = filespec.Substring(0, indexOfSeparatorBeforeWildCard + 1); 660wildcardDirectoryPart = filespec.Substring(indexOfSeparatorBeforeWildCard + 1, indexOfLastDirectorySeparator - indexOfSeparatorBeforeWildCard); 1130pattern = indexOfNextSlash != -1 ? recursionState.RemainingWildcardDirectory.Substring(0, indexOfNextSlash) : recursionState.RemainingWildcardDirectory; 2123directoryPattern = wildcard.Substring(3, wildcardLength - 6);
FileUtilities.cs (4)
258return FixFilePath(path.Substring(start, stop - start)); 289path = path.Substring(0, path.Length - 1); 338path = $"{targetQuote}{path.Substring(1, path.Length - 2)}{targetQuote}"; 405return FixFilePath(fullPath.Substring(0, i));
FrameworkLocationHelper.cs (1)
819baseLocation.Substring(0, indexOf64) + baseLocation.Substring(indexOf64 + 2);
MSBuildNameIgnoreCaseComparer.cs (1)
190return StringComparer.OrdinalIgnoreCase.GetHashCode(obj.Substring(start, length));
PrintLineDebuggerWriters.cs (1)
80var artifactsPart = executingAssembly.Substring(0, logIndex);
ResourceUtilities.cs (2)
70code = message.Substring(i, 7); 113code = message.Substring(i, k - i);
Microsoft.Cci.Extensions (4)
Comparers\ApiComparer.cs (2)
140return i > -1 ? name.Substring(0, i) : name; 153beforeFirstDot = qualifiedName.Substring(0, firstDot);
Filters\BaselineDifferenceFilter.cs (1)
35filteredLine = filteredLine.Substring(0, index);
Writers\CSharp\CSDeclarationWriter.Properties.cs (1)
166WriteIdentifier(property.Name.Value.Substring(0, index + 1) + "this", false); // +1 to include the '.'
Microsoft.CodeAnalysis (44)
CommandLine\CommandLineParser.cs (2)
241part.Substring(0, versionParameterDesignatorLength).Equals(versionParameterDesignator, StringComparison.OrdinalIgnoreCase) && 331return i == (length - 1) ? path : path.Substring(0, i + 1);
CommandLine\CommonCompiler.cs (1)
172return hash.Substring(0, 8);
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)
293name = name.Substring(0, name.Length - 6) + "Item"; 310name = name.Substring(0, name.Length - 4) + "this[]"; 1529name = id.Substring(index, delimiterOffset - index);
FileSystem\PathUtilities.cs (9)
60s = s.Substring(0, lastSeparator); 156return path.Substring(0, i); 221return path.Substring(0, 1); 257return path.Substring(0, i); 264? path.Substring(0, 3) 265: path.Substring(0, 2); 288? path.Substring(0, 1) 481return path.Substring(0, path.Length - 1); 851var volumeSpecifier = isDriveRooted ? p.Substring(0, 2) : string.Empty;
InternalUtilities\CompilerOptionParseUtilities.cs (1)
42string name = feature.Substring(0, equals);
InternalUtilities\FileNameUtilities.cs (2)
118return path.Substring(0, index); 124return path.Substring(0, path.Length - 1);
InternalUtilities\StringExtensions.cs (2)
165result = name.Substring(0, name.Length - AttributeSuffix.Length); 222return arg.Substring(1, arg.Length - 2);
InternalUtilities\StringTable.cs (1)
504var text = chars.Substring(start, len);
MetadataReader\MetadataHelpers.cs (6)
317return _input.Substring(start, _offset - start); 403string name = _input.Substring(_offset, i - _offset); 449typeNameBuilder.Append(_input.Substring(start, _offset - start)); 459typeNameBuilder.Append(_input.Substring(start, _offset - start)); 465typeNameBuilder.Append(_input.Substring(start, _offset - start)); 946return fullName.Substring(parentNamespaceNameLength, index - parentNamespaceNameLength);
MetadataReader\PEModule.cs (2)
840string namespaceName = index >= 0 ? typeName.Substring(0, index) : ""; 859select backtickIndex < 0 ? metadataName : metadataName.Substring(0, backtickIndex);
MetadataReference\AssemblyIdentity.DisplayName.cs (2)
564value = displayName.Substring(valueStart, valueEnd - valueStart); 872int 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\Dependencies\CodeAnalysis.Debugging\CustomDebugInfoReader.cs (1)
831before = input.Substring(offset, separatorPos - offset);
Text\StringText.cs (1)
83return this.Source.Substring(span.Start, span.Length);
VersionHelper.cs (1)
116TryGetValue(elements[i].Substring(0, idx), out values[i]);
WellKnownTypes.cs (2)
750name = name.Substring(0, separator); 751typeIdName = typeIdName.Substring(0, separator);
Microsoft.CodeAnalysis.Analyzers (6)
MetaAnalyzers\DiagnosticDescriptorCreationAnalyzer_IdRangeAndCategoryValidation.cs (1)
89var suffix = ruleId[allowedIds.prefix.Length..];
MetaAnalyzers\DiagnosticDescriptorCreationAnalyzer_ResourceStringsFormat.cs (1)
103var value = valueElementStr.Substring(valueTagPrefix.Length, valueLength);
MetaAnalyzers\ReleaseTrackingHelper.cs (1)
76string versionString = lineText[ReleasePrefix.Length..].Trim();
src\RoslynAnalyzers\Microsoft.CodeAnalysis.BannedApiAnalyzers\Core\DocumentationCommentIdParser.cs (2)
91name = id[index..delimiterOffset]; 96name = id[index..];
src\RoslynAnalyzers\Utilities\Compiler\WellKnownTypeProvider.cs (1)
222namespaceNamesBuilder.Add(fullTypeName[prevStartIndex..i]);
Microsoft.CodeAnalysis.AnalyzerUtilities (1)
src\RoslynAnalyzers\Utilities\Compiler\WellKnownTypeProvider.cs (1)
222namespaceNamesBuilder.Add(fullTypeName[prevStartIndex..i]);
Microsoft.CodeAnalysis.BannedApiAnalyzers (3)
DocumentationCommentIdParser.cs (2)
91name = id[index..delimiterOffset]; 96name = id[index..];
src\RoslynAnalyzers\Utilities\Compiler\WellKnownTypeProvider.cs (1)
222namespaceNamesBuilder.Add(fullTypeName[prevStartIndex..i]);
Microsoft.CodeAnalysis.CodeStyle (34)
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (2)
311? id[CompilerErrorCodePrefix.Length..] 377trimmedPart = trimmedPart[categoryPrefix.Length..].Trim();
src\Analyzers\Core\Analyzers\RemoveUnusedMembers\AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (1)
947var suffix = methodSymbol.Name[prefix.Length..];
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\Compilers\Core\Portable\FileSystem\PathUtilities.cs (9)
60s = s.Substring(0, lastSeparator); 156return path.Substring(0, i); 221return path.Substring(0, 1); 257return path.Substring(0, i); 264? path.Substring(0, 3) 265: path.Substring(0, 2); 288? path.Substring(0, 1) 481return path.Substring(0, path.Length - 1); 851var volumeSpecifier = isDriveRooted ? p.Substring(0, 2) : string.Empty;
src\Compilers\Core\Portable\InternalUtilities\CompilerOptionParseUtilities.cs (1)
42string name = feature.Substring(0, equals);
src\Compilers\Core\Portable\InternalUtilities\FileNameUtilities.cs (2)
118return path.Substring(0, index); 124return path.Substring(0, path.Length - 1);
src\Compilers\Core\Portable\InternalUtilities\StringExtensions.cs (2)
165result = name.Substring(0, name.Length - AttributeSuffix.Length); 222return arg.Substring(1, arg.Length - 2);
src\Compilers\Core\Portable\InternalUtilities\StringTable.cs (1)
504var text = chars.Substring(start, len);
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\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\FormattingExtensions.cs (1)
261newText = newText[i..];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Naming\IdentifierNameParts.cs (2)
46? newBaseName[prefix.Length..] 76words.Add(name.Substring(part.Start, part.Length));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.cs (8)
146name = StripCommonPrefixes(name[Prefix.Length..], out var prefix); 177=> name.Substring(wordSpan.Start, wordSpan.Length); 310name = StripCommonPrefixes(name.StartsWith(Prefix) ? name[Prefix.Length..] : name, out _); 378return name[index..]; 389name = name[Prefix.Length..^Suffix.Length]; 410newWords[i] = name[parts[i].Start..parts[i].End]; 430return name + Suffix[i..]; 456if (name.StartsWith(Prefix[i..]))
Microsoft.CodeAnalysis.CSharp (23)
Binder\Binder.cs (2)
953snippet = first.Substring(0, Math.Min(first.Length, 12)) + " ... " + last.Substring(last.Length - lastSize, lastSize);
Compiler\DocumentationCommentCompiler.cs (3)
1045trimmed = trimmed.Substring(0, index); 1075return seenStar ? line.Substring(0, length) : null; 1090return str1.Substring(0, pos);
Parser\DirectiveParser.cs (1)
852string identifierPart = text.Substring(0, MAX_DIRECTIVE_IDENTIFIER_WIDTH);
Parser\LanguageParser_InterpolatedString.cs (9)
90originalText[openQuoteRange], 251originalText[closeQuoteRange], 372var expressionText = text[interpolation.OpenBraceRange.End..followingRange.Start]; 385SyntaxFactory.Token(leading: null, SyntaxKind.OpenBraceToken, text[interpolation.OpenBraceRange], openTokenTrailingTrivia)); 387Debug.Assert(text[interpolation.OpenBraceRange.Start..interpolation.CloseBraceRange.End] == result.ToFullString()); // yield from text equals yield from node 402Debug.Assert(text[interpolation.OpenBraceRange.Start..interpolation.CloseBraceRange.End] == result.ToFullString()); // yield from text equals yield from node 427SyntaxFactory.Token(leading, SyntaxKind.ColonToken, text[interpolation.ColonRange], trailing: null), 428MakeInterpolatedStringTextToken(kind, text[interpolation.ColonRange.End..interpolation.CloseBraceRange.Start])); 442text[interpolation.CloseBraceRange],
Parser\Lexer.cs (1)
1624Debug.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\AnonymousTypes\AnonymousTypeManager.Templates.cs (1)
517moduleId = moduleId.Substring(0, moduleId.Length - extension.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 (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\FormattingHelpers.cs (1)
30indent = indent[start..];
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (3)
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpCollectionExpressionRewriter.cs (1)
643? preferredIndentation + positionIndentation[firstTokenOnLineIndentationString.Length..]
src\Analyzers\CSharp\CodeFixes\UsePrimaryConstructor\CSharpUsePrimaryConstructorCodeFixProvider.cs (1)
355var indentation = constructorLeadingWhitespace[typeLeadingWhitespace.Length..];
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeSymbolExtensions.TypeSyntaxGeneratorVisitor.cs (1)
149? null : symbol.Signature.UnmanagedCallingConventionTypes.Select(type => GetConventionForString(type.Name["CallConv".Length..])),
Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests (5)
CommandLineTests.cs (5)
265return path[0..lastSlashIndex] + lastSlash + path[lastSlashIndex..]; 5913var modfile = source1.Substring(0, source1.Length - 2) + "netmodule"; 5925modfile = source2.Substring(0, source2.Length - 2) + "netmodule"; 5950var modfile = source1.Substring(0, source1.Length - 2) + "netmodule"; 5970var modfile = source1.Substring(0, source1.Length - 2) + "netmodule";
Microsoft.CodeAnalysis.CSharp.EditorFeatures (5)
StringCopyPaste\StringCopyPasteHelpers.cs (1)
147return (value[..start], value[start..]);
StringCopyPaste\UnknownSourcePasteProcessor.cs (4)
192buffer.Append(fullChangeLineText[commonIndentationPrefix.Length..]); 199buffer.Append(fullChangeLineText[commonIndentationPrefix.Length..]); 288buffer.Append(lineLeadingWhitespace[commonIndentationPrefix.Length..]); 306buffer.Append(lineLeadingWhitespace[commonIndentationPrefix.Length..]);
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (8)
CodeActions\InlineMethod\CSharpInlineMethodTests.cs (2)
101var inlinedMethod = expectedMarkUpForCallee.Substring(firstMarkerIndex + 2, secondMarkerIndex - firstMarkerIndex - 2); 135var inlinedMethod = expectedMarkUp.Substring(firstMarkerIndex + 2, secondMarkerIndex - firstMarkerIndex - 2);
Completion\CompletionProviders\AbstractCSharpCompletionProviderTests.cs (2)
101=> expectedItemOrNull[0] == '@' ? expectedItemOrNull.Substring(1, 1) : expectedItemOrNull[..1]; 111code = code[..position] + insertText + "/**/" + code[position..];
Extensions\ContextQuery\AbstractContextTests.cs (2)
35text = text[..position] + insertText + "/**/" + text[position..]; 57text = text[..position] + insertText + text[position..];
RawStringLiteral\RawStringLiteralCommandHandlerTests.cs (1)
70var virtualOffset = int.Parse(virtualSpaces.Key["VirtualSpaces-".Length..]);
StringCopyPaste\StringCopyPasteCommandHandlerTests.cs (1)
77var virtualOffset = int.Parse(virtualSpaces.Key["VirtualSpaces-".Length..]);
Microsoft.CodeAnalysis.CSharp.EditorFeatures2.UnitTests (2)
Recommendations\RecommenderTests.cs (2)
52text = text[..position] + insertText + "/**/" + text[position..]; 125text = text[..position] + insertText + text[position..];
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (2)
CodeGen\CodeGenTupleTest.cs (2)
12773Assert.Equal("public struct ValueTuple<T1, T2>", m1Tuple.OriginalDefinition.DeclaringSyntaxReferences.Single().GetSyntax().ToString().Substring(0, 32)); 12867Assert.Equal("public override string ToString()", m1ToString.DeclaringSyntaxReferences.Single().GetSyntax().ToString().Substring(0, 33));
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (1)
Semantics\PrimaryConstructorTests.cs (1)
20108" + keyword + " C1" + code.Substring(0, i) + @"
Microsoft.CodeAnalysis.CSharp.ExpressionEvaluator.ResultProvider (7)
src\Compilers\CSharp\Portable\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);
src\ExpressionEvaluator\CSharp\Source\ResultProvider\CSharpFormatter.cs (2)
58var result = name.Substring(openBracketOffset + 1, closeBracketOffset - openBracketOffset - 1); 69var result = name.Substring(openBracketOffset + 1, closeBracketOffset - openBracketOffset - 1);
src\ExpressionEvaluator\CSharp\Source\ResultProvider\CSharpResultProvider.cs (1)
57displayName = metadataName.Substring(openBracketOffset + 1, closeBracketOffset - openBracketOffset - 1);
Microsoft.CodeAnalysis.CSharp.Features (11)
CodeLens\CSharpCodeLensDisplayInfoService.cs (2)
116displayName[openParenIndex..]; 128displayName[openBracketIndex..] +
Completion\CompletionProviders\ExplicitInterfaceMemberCompletionProvider.cs (1)
121return (memberString[0..i], memberString[i..]);
ConvertPrimaryToRegularConstructor\ConvertPrimaryToRegularConstructorCodeRefactoringProvider.cs (1)
430var indentation = constructorLeadingWhitespace[typeLeadingWhitespace.Length..];
ConvertToInterpolatedString\CSharpConvertConcatenationToInterpolatedStringRefactoringProvider.cs (2)
26? text["@'".Length..^1] 27: text["'".Length..^1];
ConvertToRawString\ConvertInterpolatedStringToRawStringCodeRefactoringProvider.cs (1)
333? indentation + positionIndentation[anchorIndentation.Length..]
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpCollectionExpressionRewriter.cs (1)
643? preferredIndentation + positionIndentation[firstTokenOnLineIndentationString.Length..]
src\Analyzers\CSharp\CodeFixes\UsePrimaryConstructor\CSharpUsePrimaryConstructorCodeFixProvider.cs (1)
355var 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.Features.UnitTests (6)
EditAndContinue\BreakpointSpansTests.cs (3)
59message: $"Expected: [|{source.Substring(expectedSpan.Value.Start, expectedSpan.Value.Length)}|], Actual: [|{source.Substring(breakpointSpan.Start, breakpointSpan.Length)}|]"); 83itemInspector: span => "[|" + source.Substring(span.Start, span.Length) + "|]");
EditAndContinue\CSharpEditAndContinueAnalyzerTests.cs (2)
54var expectedText = source.Substring(expected.Start, expected.Length); 63var actualText = source.Substring(actual.Start, actual.Length);
SemanticSearch\CSharpSemanticSearchServiceTests.cs (1)
39return text[lineStart..lineEnd].Trim();
Microsoft.CodeAnalysis.CSharp.Scripting.UnitTests (1)
InteractiveSessionTests.cs (1)
1257string unrooted = file.Path[root.Length..];
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (4)
Compilation\SemanticModelGetSemanticInfoTests_LateBound.cs (1)
829Assert.Equal("dynamic.operator " + op.Substring(0, op.Length - 1) + "(dynamic, dynamic)", semanticInfo.Symbol.ToString());
Compilation\UsedAssembliesTests.cs (1)
145var beforeUsings = source.Substring(0, unit.Usings.First().FullSpan.Start);
Symbols\Metadata\PE\TypeForwarders.cs (2)
1486topLevelTypes.Add(fullName.Substring(0, plus)); 1755topLevelTypes.Add(fullName.Substring(0, plus));
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (21)
Diagnostics\LineSpanDirectiveTests.cs (1)
481description.Substring(0, index) + "...";
LexicalAndXml\LexicalTests.cs (4)
3478Assert.Equal(text.Substring(0, text.Length - 1), token.Text); 3479Assert.Equal(text.Substring(0, text.Length - 1), token.Value); 3582Assert.Equal(text.Substring(0, text.Length - 1), token.Text); 3592Assert.Equal(text.Substring(0, text.Length - 1), token.Text);
LexicalAndXml\PreprocessorTests.cs (1)
3218string actualErrorStringFileName = errorString.Substring(0, errorString.IndexOf('('));
Parsing\CrefParsingTests.cs (6)
820Diagnostic(ErrorCode.WRN_BadXMLRefSyntax, "operator " + op.Substring(0, op.Length - 2)).WithArguments("operator " + op).WithLocation(1, 16) 860Diagnostic(ErrorCode.WRN_BadXMLRefSyntax, "operator " + op.Substring(0, op.Length - 4)).WithArguments("operator " + op).WithLocation(1, 16) 900Diagnostic(ErrorCode.WRN_BadXMLRefSyntax, "operator " + op.Substring(0, op.Length - 3)).WithArguments("operator " + op).WithLocation(1, 16) 1447Diagnostic(ErrorCode.WRN_BadXMLRefSyntax, "T.operator " + op.Substring(0, op.Length - 2)).WithArguments("T.operator " + op).WithLocation(1, 16) 1505Diagnostic(ErrorCode.WRN_BadXMLRefSyntax, "T.operator " + op.Substring(0, op.Length - 4)).WithArguments("T.operator " + op).WithLocation(1, 16) 1563Diagnostic(ErrorCode.WRN_BadXMLRefSyntax, "T.operator " + op.Substring(0, op.Length - 3)).WithArguments("T.operator " + op).WithLocation(1, 16)
Parsing\PatternParsingTests.cs (1)
2994string source2 = source.Substring(0, k1) + source.Substring(k2);
Parsing\Utf8StringLiteralsParsingTests.cs (4)
689Diagnostic(ErrorCode.ERR_UnexpectedToken, @"""""""hello""""""" + suffix.Substring(0, 2)).WithArguments("0").WithLocation(1, 1) 694N(SyntaxKind.Utf8SingleLineRawStringLiteralToken, "\"\"\"hello\"\"\"" + suffix.Substring(0, 2)); 873""""""" + suffix.Substring(0, 2)).WithArguments("0").WithLocation(1, 1) 880" + "\"\"\"" + suffix.Substring(0, 2));
TextExtensions.cs (4)
26var newFullText = oldFullText.Substring(0, offset) + newText + oldFullText.Substring(span.End); 36var newFullText = oldFullText.Substring(0, offset) + newText + oldFullText.Substring(span.End); 46var newFullText = oldFullText.Substring(0, offset) + newText + oldFullText.Substring(span.End); 60var newFullText = oldFullText.Substring(0, offset) + newText + oldFullText.Substring(offset);
Microsoft.CodeAnalysis.CSharp.Test.Utilities (6)
CompilationTestUtils.cs (1)
505var content = text.Substring(prefix.Length, text.Length - prefix.Length - suffix.Length);
CSharpTestBase.cs (3)
1713exprFullText = exprFullText[exprFullText.IndexOf('\n')..].Trim(); 1863var bindText = text.Substring(start, end - start).Trim(); 1985text = text.Substring(0, length);
Extensions.cs (1)
492nameOnly = expType.Name.Substring(0, idx);
TestAttributesVisitor.cs (1)
161if (name.EndsWith("Attribute")) name = name.Substring(0, name.Length - 9);
Microsoft.CodeAnalysis.CSharp.Workspaces (2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\FormattingHelpers.cs (1)
30indent = indent[start..];
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeSymbolExtensions.TypeSyntaxGeneratorVisitor.cs (1)
149? null : symbol.Signature.UnmanagedCallingConventionTypes.Select(type => GetConventionForString(type.Name["CallConv".Length..])),
Microsoft.CodeAnalysis.Debugging.Package (1)
CustomDebugInfoReader.cs (1)
831before = input.Substring(offset, separatorPos - offset);
Microsoft.CodeAnalysis.EditorFeatures (5)
CommentSelection\AbstractToggleBlockCommentBase.cs (1)
351=> SnapshotSpan.Snapshot.GetText().Substring(position, length);
DocumentationComments\CopilotGenerateDocumentationCommentProvider.cs (3)
123var parameterName = comments.Substring(typeParamNameStart, typeParamNameEnd - typeParamNameStart); 144var parameterName = comments.Substring(paramNameStart, paramNameEnd - paramNameStart); 171var exceptionName = comments.Substring(exceptionNameStart, exceptionNameEnd - exceptionNameStart);
IntelliSense\AsyncCompletion\Helpers.cs (1)
40.WithDisplayText(item.DisplayText[Completion.Utilities.UnicodeStarAndSpace.Length..])
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (9)
AbstractCommandHandlerTestState.cs (1)
216var textAfterCaret = text[lineCaretPosition..];
AutomaticCompletion\AbstractAutomaticLineEnderTests.cs (1)
70var markupCode = code[0..position] + "$$" + code[position..];
Classification\ClassificationTestHelper.cs (1)
54var text = actualText.Substring(actual.TextSpan.Start, actual.TextSpan.Length);
Classification\FormattedClassification.cs (1)
52var remainder = ClassificationName[kvp.Key.Length..];
Completion\AbstractCompletionProviderTests.cs (3)
1072code = code[..position] + insertText + code[position..]; 1108code = code[..position] + insertText + code[position..]; 1161code = code[..position] + insertText + code[position..];
Workspaces\EditorTestWorkspace.cs (2)
365var textToAdd = inertText[currentPositionInInertText..spanLocation]; 419projectionBufferSpans.Add(inertText[currentPositionInInertText..]);
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (4)
EmbeddedLanguages\StackFrame\StackFrameParserTests.Utilities.cs (2)
75StackFrameParser.TryParse(input[i..]); 140sb.Append(s[start..end]);
Snippets\RoslynLSPSnippetConvertTests.cs (2)
492var textChange = new TextChange(new TextSpan(stringSpan.Start, 0), text.Substring(stringSpan.Start, stringSpan.Length)); 509var placeholderText = text.Substring(spans[0].Start, spans[0].Length);
Microsoft.CodeAnalysis.EditorFeatures2.UnitTests (5)
IntelliSense\CSharpCompletionCommandHandlerTests.vb (1)
10613state.SendTypeChars(second.Substring(0, 3))
IntelliSense\CSharpCompletionCommandHandlerTests_AwaitCompletion.vb (2)
813Await state.AssertLineTextAroundCaret($" {committedAwait.Substring(0, committedCursorPosition)}", committedAwait.Substring(committedCursorPosition)) 828Dim committedAwaitfBeforeCursor = committedAwaitf.Substring(0, committedCursorPosition)
IntelliSense\CSharpCompletionCommandHandlerTests_XmlDoc.vb (1)
757state.SendTypeChars(keyword.Substring(0, keyword.Length - 1))
IntelliSense\VisualBasicCompletionCommandHandlerTests_XmlDoc.vb (1)
682state.SendTypeChars(keyword.Substring(0, keyword.Length - 1))
Microsoft.CodeAnalysis.ExpressionEvaluator.ExpressionCompiler (2)
CustomTypeInfo.cs (1)
186var name = (next < 0) ? str.Substring(offset) : str.Substring(offset, next - offset);
MetadataUtilities.cs (1)
387return fileName.Substring(0, lastDotIndex);
Microsoft.CodeAnalysis.ExpressionEvaluator.FunctionResolver (9)
CSharp\Scanner.cs (1)
126var text = _text.Substring(start, _offset - start);
MetadataDecoder.cs (1)
297return typeName.Substring(0, index);
MetadataResolver.cs (1)
460return (index < 0) ? typeName : typeName.Substring(0, index);
src\Compilers\CSharp\Portable\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);
VisualBasic\Scanner.cs (2)
97var text = _text.Substring(_offset, n); 116var text = _text.Substring(_offset, n);
Microsoft.CodeAnalysis.ExpressionEvaluator.FunctionResolver.UnitTests (2)
FunctionResolverTestBase.cs (1)
97typeName = typeName.Substring(0, index);
VisualBasicParsingTests.cs (1)
71var expectedText = kindText.Substring(0, kindText.Length - keywordSuffix.Length);
Microsoft.CodeAnalysis.ExpressionEvaluator.ResultProvider (4)
src\ExpressionEvaluator\Core\Source\ExpressionCompiler\CustomTypeInfo.cs (1)
186var name = (next < 0) ? str.Substring(offset) : str.Substring(offset, next - offset);
src\ExpressionEvaluator\Core\Source\ResultProvider\Formatter.cs (2)
304return expression.Substring(start, length - start); 348return expression.Substring(0, newLength);
src\ExpressionEvaluator\Core\Source\ResultProvider\Formatter.TypeNames.cs (1)
362var unmangledName = separatorIndex < 0 ? mangledName : mangledName.Substring(0, separatorIndex);
Microsoft.CodeAnalysis.ExpressionEvaluator.ResultProvider.Utilities (8)
Debugger\Engine\DkmClrType.cs (1)
184proxyName = proxyName.Substring(0, separator);
Debugger\Engine\DkmClrValue.cs (3)
270string name = formatString.Substring(openPos + 1, i - openPos - 1); 290name = name.Substring(0, commaIndex); 334name = name.Substring(0, openParenIndex);
src\ExpressionEvaluator\Core\Source\ExpressionCompiler\CustomTypeInfo.cs (1)
186var name = (next < 0) ? str.Substring(offset) : str.Substring(offset, next - offset);
src\ExpressionEvaluator\Core\Source\ResultProvider\Formatter.cs (2)
304return expression.Substring(start, length - start); 348return expression.Substring(0, newLength);
src\ExpressionEvaluator\Core\Source\ResultProvider\Formatter.TypeNames.cs (1)
362var unmangledName = separatorIndex < 0 ? mangledName : mangledName.Substring(0, separatorIndex);
Microsoft.CodeAnalysis.Features (23)
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)
259var projectGuid = Guid.Parse(projectIds.Substring(start, current - start)); 271var projectGuid = Guid.Parse(projectIds.Substring(start, current - start));
ConvertToInterpolatedString\ConvertRegularStringToInterpolatedStringRefactoringProvider.cs (1)
87return text[startIndex..^1];
EditAndContinue\Utilities\Extensions.cs (1)
195parameterName = fieldName.Substring(1, closing - 1);
GenerateType\AbstractGenerateTypeService.Editor.cs (2)
171namespaceToGenerateInto = namespaceToGenerateInto[rootNamespace.Length..]; 213namespaceToGenerateInto = namespaceToGenerateInto[rootNamespaceLength..];
MetadataAsSource\DocumentationCommentUtilities.cs (1)
25str = str[docCommentPrefix.Length..];
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)
116param = xmlFunctionText.Substring(paramStart, paramLength);
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (2)
311? id[CompilerErrorCodePrefix.Length..] 377trimmedPart = trimmedPart[categoryPrefix.Length..].Trim();
src\Analyzers\Core\Analyzers\RemoveUnusedMembers\AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (1)
947var suffix = methodSymbol.Name[prefix.Length..];
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\Dependencies\CodeAnalysis.Debugging\CustomDebugInfoReader.cs (1)
831before = input.Substring(offset, separatorPos - offset);
TaskList\AbstractTaskListService.cs (1)
108var trimmedMessage = message[index..];
Microsoft.CodeAnalysis.Features.Test.Utilities (6)
EditAndContinue\ActiveStatementTestHelpers.cs (3)
62src = src[..start] + src[end..]; 84var lineCount = int.Parse(src[startOfLineCount..endOfLineCount]); 88src = src[..start] + string.Join("", Enumerable.Repeat(Environment.NewLine, lineCount)) + src[end..];
EditAndContinue\EditAndContinueWorkspaceTestBase.cs (1)
490return markedSource[index..closing].Trim();
EditAndContinue\Extensions.cs (2)
47yield return str[i..]; 51yield return str[i..eoln];
Microsoft.CodeAnalysis.InteractiveHost (11)
src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (9)
60s = s.Substring(0, lastSeparator); 156return path.Substring(0, i); 221return path.Substring(0, 1); 257return path.Substring(0, i); 264? path.Substring(0, 3) 265: path.Substring(0, 2); 288? path.Substring(0, 1) 481return path.Substring(0, path.Length - 1); 851var volumeSpecifier = isDriveRooted ? p.Substring(0, 2) : string.Empty;
src\Compilers\Core\Portable\InternalUtilities\FileNameUtilities.cs (2)
118return path.Substring(0, index); 124return path.Substring(0, path.Length - 1);
Microsoft.CodeAnalysis.LanguageServer.Protocol (3)
Handler\InlineCompletions\XmlSnippetParser.CodeSnippet.cs (3)
202var token = _code.Substring(currentTokenCharIndex, iTokenLen); 225var fieldName = _code.Substring(currentTokenCharIndex, fieldNameLength); 272var remaining = _code[currentTokenCharIndex..currentCharIndex];
Microsoft.CodeAnalysis.PublicApiAnalyzers (2)
DeclarePublicApiAnalyzer.cs (1)
186var removedText = text[RemovedApiPrefix.Length..];
src\RoslynAnalyzers\Utilities\Compiler\WellKnownTypeProvider.cs (1)
222namespaceNamesBuilder.Add(fullTypeName[prevStartIndex..i]);
Microsoft.CodeAnalysis.Rebuild (1)
RebuildSourceReferenceResolver.cs (1)
57var root = baseFilePath.Substring(0, index);
Microsoft.CodeAnalysis.Remote.Workspaces (2)
BrokeredServiceDescriptors.cs (1)
26name => CommonMethodNameTransforms.CamelCase(name.EndsWith(AsyncSuffix, StringComparison.OrdinalIgnoreCase) ? name.Substring(0, name.Length - AsyncSuffix.Length) : name);
ServiceDescriptors.cs (1)
119return interfaceName.Substring(InterfaceNamePrefix.Length, interfaceName.Length - InterfaceNamePrefix.Length - InterfaceNameSuffix.Length);
Microsoft.CodeAnalysis.ResxSourceGenerator (3)
AbstractResxGenerator.cs (2)
419var docCommentString = value.Length > maxDocCommentLength ? value.Substring(0, maxDocCommentLength) + " ..." : value; 811namespaceName = fullName.Substring(0, lastDot);
src\RoslynAnalyzers\Utilities\Compiler\WellKnownTypeProvider.cs (1)
222namespaceNamesBuilder.Add(fullTypeName[prevStartIndex..i]);
Microsoft.CodeAnalysis.Scripting (2)
Hosting\ObjectFormatter\ObjectFormatterHelpers.cs (1)
453return str.Substring(start, i - start + 1);
Hosting\Resolvers\NuGetPackageResolver.cs (1)
24var parts = reference[ReferencePrefix.Length..].Split('/');
Microsoft.CodeAnalysis.Test.Utilities (3)
Compilation\OperationTreeVerifier.cs (2)
173var prefix = firstLine.Length <= maxTokenLength ? firstLine : firstLine.Substring(0, maxTokenLength); 174var suffix = lastLine.Length <= maxTokenLength ? lastLine : lastLine.Substring(lastLine.Length - maxTokenLength, maxTokenLength);
Metadata\ILValidation.cs (1)
434=> (text.Length < maxLength) ? text : text.Substring(text.Length - maxLength - 1, maxLength);
Microsoft.CodeAnalysis.UnitTests (6)
Diagnostics\SuppressMessageAttributeCompilerTests.cs (1)
167exception.ToString().Substring(0, exception.ToString().IndexOf("---")) + "-----" + Environment.NewLine + Environment.NewLine +
Text\LargeTextTests.cs (1)
168Assert.Equal(text.ToString().Substring(start, length), textLine.ToString());
Text\SourceTextTests.cs (1)
449Assert.Equal(Text.Substring(span.Start, span.Length), writer.ToString());
Text\StringTextTest.cs (1)
121Assert.Equal(text.ToString().Substring(start, length), textLine.ToString());
Text\TextChangeTests.cs (2)
357expected = expected.Substring(0, 50 + i) + c + expected.Substring(50 + i); 377expected = expected.Substring(0, i) + c + str.Substring(i + 1);
Microsoft.CodeAnalysis.VisualBasic (15)
Binding\Binder_Symbols.vb (1)
388currDiagName = currDiagName.Substring(0, currDiagName.LastIndexOf("."c))
CommandLine\VisualBasicCommandLineParser.vb (3)
810AddDiagnostic(diagnostics, ERRID.ERR_SwitchNeedsBool, name.Substring(0, name.Length - 1)) 819AddDiagnostic(diagnostics, ERRID.ERR_SwitchNeedsBool, name.Substring(0, name.Length - 1)) 1040AddDiagnostic(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)
5410Dim lessThanText = tokenText.Substring(0, 1) 5411Dim greaterThanText = tokenText.Substring(tokenLength - 1, 1) 5412Dim 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)
204moduleId = 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\Workspaces\VisualBasic\Portable\Formatting\Engine\Trivia\TriviaDataFactory.vb (1)
118Debug.Assert(originalString.Substring(0, 4) = " _" & vbCrLf)
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (6)
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\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.EditorFeatures (3)
AutomaticEndConstructCorrection\AutomaticEndConstructCorrector.vb (1)
309Dim textUnderPosition = text.Substring(startIndex, length)
AutomaticEndConstructCorrection\LetterOnlyTrackingSpan.vb (2)
140If AutomaticEndConstructSet.Contains(text.Substring(firstLetterIndex, length)) Then 156Dim candidate = text.Substring(firstLetterIndex, length)
Microsoft.CodeAnalysis.VisualBasic.ExpressionCompiler (1)
SyntaxHelpers.vb (1)
97Dim token = expr.Substring(start, offset - start)
Microsoft.CodeAnalysis.VisualBasic.Features (10)
CodeLens\VisualBasicDisplayInfoService.vb (1)
112Dim symbolNameWithNoParams As String = symbolName.Substring(0, openParenIndex)
Completion\CompletionProviders\CompletionUtilities.vb (2)
133Return insertionText.Substring(0, insertionText.IndexOf("("c)) 147Return insertionText.Substring(0, insertionText.Length - 1)
Completion\CompletionProviders\NamedParameterCompletionProvider.vb (2)
235change = New TextChange(symbolItem.Span, insertionText.Substring(0, insertionText.Length - s_colonEquals.Length)) 237change = 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)
389Dim 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.Features.UnitTests (4)
EditAndContinue\BreakpointSpansTests.vb (3)
61source.Substring(expectedSpan.Value.Start, expectedSpan.Value.Length), 63source.Substring(breakpointSpan.Start, breakpointSpan.Length))) 81itemInspector:=Function(span) "[|" & source.Substring(span.Start, span.Length) & "|]")
EditAndContinue\VisualBasicEditAndContinueAnalyzerTests.vb (1)
38Dim expectedText As String = source.Substring(expectedSpan.Start, expectedSpan.Length)
Microsoft.CodeAnalysis.VisualBasic.ResultProvider (1)
src\ExpressionEvaluator\VisualBasic\Source\ResultProvider\VisualBasicFormatter.vb (1)
72Return expression.Substring(0, index)
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (1)
Binding\BindingScopeTests.vb (1)
31Dim locationText = If(treeText.Length > position + 50, treeText.Substring(position, 50), treeText.Substring(position))
Microsoft.CodeAnalysis.VisualBasic.Syntax.UnitTests (2)
IncrementalParser\IncrementalParser.vb (2)
112Dim newText = text.WithChanges(New TextChange(New TextSpan(text.Length, 0), _s.Substring(i, 1))) 1557Dim newText = oldText.Replace(TextSpan.FromBounds(startOfOld, endOfOld), newSource.Substring(startOfNew, endOfNew - startOfNew + 1))
Microsoft.CodeAnalysis.VisualBasic.Test.Utilities (4)
CompilationTestUtils.vb (3)
485Dim commentText = text.Substring(startCommentIndex, endCommentIndex - startCommentIndex) 494bindText = commentText.Substring(0, endBindCommentLength) 705names.Add(methodName.Substring(offset, separator - offset))
SemanticModelTestBase.vb (1)
59bindText = text.Substring(bindCommentIndex, text.IndexOf(""""c, bindCommentIndex) - bindCommentIndex)
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)
Formatting\Engine\Trivia\TriviaDataFactory.vb (1)
118Debug.Assert(originalString.Substring(0, 4) = " _" & vbCrLf)
Rename\VisualBasicRenameRewriterLanguageService.vb (2)
306Dim prefix = If(isRenameLocation AndAlso Me._renameLocations(token.Span).IsRenamableAccessor, newToken.ValueText.Substring(0, newToken.ValueText.IndexOf("_"c) + 1), String.Empty) 987Dim conflict = replacementText.Substring(0, replacementText.Length - AttributeSuffixLength)
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\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 (33)
PatternMatching\PatternMatcher.PatternSegment.cs (2)
99result[resultIndex++] = new TextChunk(pattern.Substring(wordStart, wordLength), allowFuzzyMatching); 107result[resultIndex++] = new TextChunk(pattern.Substring(wordStart, wordLength), allowFuzzyMatching);
Rename\RenameUtilities.cs (3)
268if (replaceInsideString.Substring(subSpan.Start, subSpan.Length) != matchText) 273stringBuilder.Append(replaceInsideString.Substring(startOffset, offset)); 283stringBuilder.Append(replaceInsideString[startOffset..]);
src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (9)
60s = s.Substring(0, lastSeparator); 156return path.Substring(0, i); 221return path.Substring(0, 1); 257return path.Substring(0, i); 264? path.Substring(0, 3) 265: path.Substring(0, 2); 288? path.Substring(0, 1) 481return path.Substring(0, path.Length - 1); 851var volumeSpecifier = isDriveRooted ? p.Substring(0, 2) : string.Empty;
src\Compilers\Core\Portable\InternalUtilities\CompilerOptionParseUtilities.cs (1)
42string name = feature.Substring(0, equals);
src\Compilers\Core\Portable\InternalUtilities\FileNameUtilities.cs (2)
118return path.Substring(0, index); 124return path.Substring(0, path.Length - 1);
src\Compilers\Core\Portable\InternalUtilities\StringExtensions.cs (2)
165result = name.Substring(0, name.Length - AttributeSuffix.Length); 222return arg.Substring(1, arg.Length - 2);
src\Compilers\Core\Portable\InternalUtilities\StringTable.cs (1)
504var text = chars.Substring(start, len);
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\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\FormattingExtensions.cs (1)
261newText = newText[i..];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Naming\IdentifierNameParts.cs (2)
46? newBaseName[prefix.Length..] 76words.Add(name.Substring(part.Start, part.Length));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.cs (8)
146name = StripCommonPrefixes(name[Prefix.Length..], out var prefix); 177=> name.Substring(wordSpan.Start, wordSpan.Length); 310name = StripCommonPrefixes(name.StartsWith(Prefix) ? name[Prefix.Length..] : name, out _); 378return name[index..]; 389name = name[Prefix.Length..^Suffix.Length]; 410newWords[i] = name[parts[i].Start..parts[i].End]; 430return name + Suffix[i..]; 456if (name.StartsWith(Prefix[i..]))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (1)
379return name.Substring(p.Start, p.Length).ToCamelCase();
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (16)
MSBuild\ProjectFile\ProjectFile.cs (1)
349return normalizedPath[projectDirectory.Length..];
src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (9)
60s = s.Substring(0, lastSeparator); 156return path.Substring(0, i); 221return path.Substring(0, 1); 257return path.Substring(0, i); 264? path.Substring(0, 3) 265: path.Substring(0, 2); 288? path.Substring(0, 1) 481return path.Substring(0, path.Length - 1); 851var volumeSpecifier = isDriveRooted ? p.Substring(0, 2) : string.Empty;
src\Compilers\Core\Portable\InternalUtilities\CompilerOptionParseUtilities.cs (1)
42string name = feature.Substring(0, equals);
src\Compilers\Core\Portable\InternalUtilities\FileNameUtilities.cs (2)
118return path.Substring(0, index); 124return path.Substring(0, path.Length - 1);
src\Compilers\Core\Portable\InternalUtilities\StringExtensions.cs (2)
165result = name.Substring(0, name.Length - AttributeSuffix.Length); 222return arg.Substring(1, arg.Length - 2);
src\Compilers\Core\Portable\InternalUtilities\StringTable.cs (1)
504var text = chars.Substring(start, len);
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (1)
FileSet.cs (1)
71var newContent = textContent[..(startTagEnd + 1)] + elementValue + textContent[endTagStart..];
Microsoft.CodeAnalysis.Workspaces.UnitTests (2)
SyntaxPathTests.cs (1)
415var newFullText = oldFullText[..offset] + newText + oldFullText[span.End..];
UtilityTest\BKTreeTests.cs (1)
110=> value[..i] + v + value[i..];
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.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.ArcadeLogging (1)
PipelinesLogger.cs (1)
347string name = str.Substring(0, valueDelimiterIndex);
Microsoft.DotNet.AsmDiff (1)
DiffApiDefinition.cs (1)
37return Difference.ToString().Substring(0, 1) + " " + Definition.UniqueId();
Microsoft.DotNet.Build.Manifest (2)
MSBuildListSplitter.cs (1)
37var key = item.Substring(0, splitIdx).Trim();
VersionIdentifier.cs (1)
111nextSegment = assetPathSegment.Substring(currentIndex, nextDelimiterIndex - currentIndex);
Microsoft.DotNet.Build.Tasks.Feed (2)
src\CreateAzureDevOpsFeed.cs (2)
109string baseFeedName = FeedName ?? $"darc-{GetFeedVisibilityTag(AzureDevOpsOrg, AzureDevOpsProject)}{extraContentInfo}-{feedCompatibleRepositoryName}-{CommitSha.Substring(0, ShaUsableLength)}"; 214return project.Substring(0, Math.Min(3, project.Length));
Microsoft.DotNet.Build.Tasks.Installers (6)
src\ArWriter.cs (6)
32Write(Encoding.ASCII.GetBytes(entry.Name.PadRight(16, ' ').Substring(0, 16))); 33Write(Encoding.ASCII.GetBytes(entry.Timestamp.ToString().PadRight(12, ' ').Substring(0, 12))); 34Write(Encoding.ASCII.GetBytes(entry.OwnerID.ToString().PadRight(6, ' ').Substring(0, 6))); 35Write(Encoding.ASCII.GetBytes(entry.GroupID.ToString().PadRight(6, ' ').Substring(0, 6))); 36Write(Encoding.ASCII.GetBytes(Convert.ToString(entry.Mode, 8).PadRight(8, ' ').Substring(0, 8))); 40Write(Encoding.ASCII.GetBytes(length.ToString().PadRight(10, ' ').Substring(0, 10)));
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 (2)
Utils.cs (1)
37return result.Substring(0, 32);
WorkloadManifestPackage.wix.cs (1)
148packageId.Substring(0, packageId.IndexOf(ManifestSeparator)) :
Microsoft.DotNet.GenFacades (1)
SourceGenerator.cs (1)
124sb.Append(typeName.Substring(0, splitIndex));
Microsoft.DotNet.Helix.Client (3)
generated-code\HelixApi.cs (2)
228return result.Substring(1, result.Length - 2); 320result += responseContent.Length < 300 ? responseContent : responseContent.Substring(0, 300);
generated-code\PagedResponse.cs (1)
130var key = value.Substring(0, equalIdx).Trim();
Microsoft.DotNet.Helix.JobSender (1)
JobDefinition.cs (1)
277string queueInfo = value.Substring(0, @index);
Microsoft.DotNet.Helix.Sdk (3)
CreateXHarnessAppleWorkItems.cs (1)
108workItemName = workItemName.Substring(0, workItemName.Length - 4);
CreateXUnitWorkItems.cs (1)
128assemblyBaseName = assemblyBaseName.Substring(0, assemblyBaseName.Length - 4);
DownloadFromResultsContainer.cs (1)
117var strippedFileUri = new Uri(fileAvailableForDownload.Link.Substring(0, fileAvailableForDownload.Link.LastIndexOf('?')));
Microsoft.DotNet.NuGetRepack.Tasks (1)
src\NuGetUtils.cs (1)
17dirName = (lastSeparator == -1) ? "" : (lastSeparator == 0) ? "/" : partName.Substring(0, lastSeparator);
Microsoft.DotNet.SignCheckLibrary (3)
Verification\Jar\JarIndividualSection.cs (1)
53entryText = RawText.Substring(entryStartIndex, entryLength);
Verification\Jar\JarManifestFileBase.cs (1)
117MainSectionText = ManifestText.Substring(0, mainSectionLength);
Verification\Jar\JarUtils.cs (1)
67return digestIndex > 0 ? attribute.Substring(0, digestIndex) : String.Empty;
Microsoft.DotNet.SignTool (2)
src\ContentUtil.cs (1)
58bytes[i / 2] = Convert.ToByte(hash.Substring(i, 2), 16);
src\ZipData.cs (1)
607fileContents = fileContents.Replace(fileContents.Substring(index, end - index), stringToFind + createMD5SumsFileTask.InstalledSize);
Microsoft.DotNet.SourceBuild.Tasks (1)
src\UsageReport\WriteUsageReports.cs (1)
207Repo = filename.Substring(
Microsoft.DotNet.SwaggerGenerator.CodeGenerator (1)
Languages\Language.cs (1)
32relative = relative.Substring(0, relative.Length - 3); // Remove extension
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)
Functions\AIFunctionFactory.cs (1)
833name = name.Substring(0, name.Length - AsyncSuffix.Length);
Microsoft.Extensions.AI.Abstractions (1)
Contents\DataContent.cs (1)
235$"Data = {uri.Substring(0, MaxLength)}...";
Microsoft.Extensions.AI.Evaluation.Reporting (1)
Formats\Html\HtmlReportWriter.cs (1)
98HtmlTemplateBefore = 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 (3)
PromptBasedFunctionCallingChatClient.cs (1)
117var id = Guid.NewGuid().ToString().Substring(0, 6);
VerbatimMultiPartHttpHandler.cs (2)
105string headers = part.Substring(0, headerEnd).Trim(); 185return headers.Substring(start, end - start).Trim('"');
Microsoft.Extensions.AI.Ollama (1)
OllamaChatClient.cs (1)
286var id = Guid.NewGuid().ToString().Substring(0, 8);
Microsoft.Extensions.AI.Templates.Tests (1)
Infrastructure\TemplateExecutionTestClassFixtureBase.cs (1)
42=> prefix + "_" + Guid.NewGuid().ToString("N").Substring(0, 10).ToLowerInvariant();
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.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.DependencyInjection (2)
DependencyInjectionEventSource.cs (2)
118format.Substring(i * MaxChunkSize, Math.Min(MaxChunkSize, format.Length - i * MaxChunkSize)), i, chunkCount, 233descriptorString.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); 769string name = Pool(nameWithVersion.Substring(0, separatorPosition));
RuntimeAssembly.cs (1)
42assemblyName = assemblyName.Substring(0, assemblyName.Length - NativeImageSufix.Length);
Microsoft.Extensions.Diagnostics.ResourceMonitoring.Tests (2)
Linux\Resources\HardcodedValueFileSystem.cs (2)
56destination.Write(newLineIndex != -1 ? content.Substring(0, newLineIndex) : content); 112destination.Write(newLineIndex != -1 ? content.Substring(start, newLineIndex - start) : content);
Microsoft.Extensions.FileProviders.Embedded (1)
EmbeddedFileProvider.cs (1)
95subpath = subpath.Substring(1, subpath.Length - 1);
Microsoft.Extensions.FileSystemGlobbing (2)
InMemoryDirectoryInfo.cs (1)
102string name = file.Substring(0, endSegment);
Internal\Patterns\PatternBuilder.cs (1)
214return pattern.Substring(beginIndex, endIndex - beginIndex);
Microsoft.Extensions.Http.Diagnostics.Tests (4)
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 (1)
161responseBody.Should().Be(bigContent.Substring(0, limit));
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)
450loggerName = loggerName.Substring(0, loggerName.Length - 1);
Microsoft.Extensions.Logging.Generators (1)
LoggerMessageGenerator.Parser.cs (1)
773string 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; 405return Buffer.Substring(Offset + offset, length);
Microsoft.Extensions.Telemetry (2)
Http\HttpRouteParser.cs (2)
131httpRoute = httpRoute.Substring(0, pos); 243return httpRoute.Substring(start, end - start);
Microsoft.Gen.ComplianceReports (2)
Parser.cs (1)
260name = name.Substring(0, name.Length - "Attribute".Length);
src\Generators\Shared\GeneratorUtilities.cs (1)
60_ = shortAttributeNames.Add(n.Substring(index, n.Length - index - "Attribute".Length));
Microsoft.Gen.ContextualOptions (1)
src\Generators\Shared\GeneratorUtilities.cs (1)
60_ = shortAttributeNames.Add(n.Substring(index, n.Length - index - "Attribute".Length));
Microsoft.Gen.Logging (3)
Parsing\TemplateProcessor.cs (2)
58var templateName = message.Substring(openBraceIndex + 1, formatDelimiterIndex - openBraceIndex - 1).Trim(); 114var templateName = message.Substring(openBraceIndex + 1, formatDelimiterIndex - openBraceIndex - 1).Trim();
src\Generators\Shared\GeneratorUtilities.cs (1)
60_ = shortAttributeNames.Add(n.Substring(index, n.Length - index - "Attribute".Length));
Microsoft.Gen.MetadataExtractor (2)
src\Generators\Microsoft.Gen.ComplianceReports\Parser.cs (1)
260name = name.Substring(0, name.Length - "Attribute".Length);
src\Generators\Shared\GeneratorUtilities.cs (1)
60_ = shortAttributeNames.Add(n.Substring(index, n.Length - index - "Attribute".Length));
Microsoft.Gen.Metrics (1)
src\Generators\Shared\GeneratorUtilities.cs (1)
60_ = shortAttributeNames.Add(n.Substring(index, n.Length - index - "Attribute".Length));
Microsoft.Gen.MetricsReports (1)
src\Generators\Shared\GeneratorUtilities.cs (1)
60_ = shortAttributeNames.Add(n.Substring(index, n.Length - index - "Attribute".Length));
Microsoft.Interop.ComInterfaceGenerator (1)
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)
645preferCollectionExpressionsRule = preferCollectionExpressionsRule.Substring(0, indexOfColon);
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.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\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\LearningRateSchedulingCifarResnetTransferLearning.cs (2)
216label = label.Substring(0, index); 254label = 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)
569var op = operation.Substring(0, p);
Microsoft.ML.TensorFlow.Tests (1)
TensorflowTests.cs (1)
1933label = 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)
177merges.Push((merge.Substring(0, index), merge.Substring(index + 1))); 1165merges.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 (8)
src\Microsoft.ML.Tokenizers\Utils\Helpers.netstandard.cs (1)
36public static byte[] FromBase64String(string base64String, int offset, int length) => Convert.FromBase64String(base64String.Substring(offset, 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)
567var op = operation.Substring(0, p);
Microsoft.NET.StringTools.net35.UnitTests (2)
SpanBasedStringBuilder_Tests.cs (2)
116stringBuilder.Append(testString.Substring(0, i)); 117stringBuilder.Append(testString.Substring(i, j - i));
Microsoft.NET.StringTools.UnitTests (2)
SpanBasedStringBuilder_Tests.cs (2)
116stringBuilder.Append(testString.Substring(0, i)); 117stringBuilder.Append(testString.Substring(i, j - i));
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.LanguageServices (10)
ColorSchemes\ColorSchemeApplier.ColorSchemeReader.cs (3)
96var r = sourceColor.Substring(2, 2); 97var g = sourceColor.Substring(4, 2); 98var b = sourceColor.Substring(6, 2);
GenerateType\GenerateTypeDialogViewModel.cs (1)
325var folderPath = this.FullFilePath[projectRootPath.Length..];
Library\ObjectBrowser\AbstractObjectBrowserLibraryManager_Search.cs (1)
30searchText = searchText[openParenIndex..];
Library\VsNavInfo\Extensions.cs (2)
28builder.Add(name[start..separatorPos], type); 35builder.Add(name[start..], type);
Venus\ContainedDocument.cs (2)
519var snippetInRightText = rightText.Substring(spanInRightText.Start, spanInRightText.Length); 570snippetInRightText[firstLineOfRightTextSnippet.Length..]);
Venus\ContainedLanguageCodeSupport.cs (1)
421var memberName = fullyQualifiedName.Substring(lastDot + 1, fullyQualifiedName.Length - lastDot - 1);
Microsoft.VisualStudio.LanguageServices.UnitTests (1)
Debugging\VisualBasicBreakpointResolutionServiceTests.vb (1)
33source.Substring(expectedSpan.Value.Start, expectedSpan.Value.Length),
Microsoft.VisualStudio.LanguageServices.VisualBasic (7)
CodeModel\VisualBasicCodeModelService.NodeNameGenerator.vb (2)
114name = name.Substring(0, name.Length - 7) 116name = name.Substring(0, name.Length - 5)
CodeModel\VisualBasicCodeModelService.vb (5)
850name.Substring(1, name.Length - 2), 1973parameterName.Substring(0, parameterName.Length - 1), 4040If CaseInsensitiveComparison.Equals(eventName.Substring(0, parentName.Length), parentName) Then 4049Return EscapeIfNotMeMyBaseOrMyClass(eventName.Substring(0, dotIndex)) & eventName.Substring(dotIndex) 4106Dim containerName = newEventName.Substring(0, indexOfDot)
Microsoft.Web.Xdt.Extensions (1)
InsertOrAppendAttribute.cs (1)
67var value = trimmedArg.Substring(start, last - start);
MSBuild (10)
FileUtilities.cs (3)
258return FixFilePath(path.Substring(start, stop - start)); 289path = path.Substring(0, path.Length - 1); 405return FixFilePath(fullPath.Substring(0, i));
MSBuildNameIgnoreCaseComparer.cs (1)
190return StringComparer.OrdinalIgnoreCase.GetHashCode(obj.Substring(start, length));
PrintLineDebuggerWriters.cs (1)
80var artifactsPart = executingAssembly.Substring(0, logIndex);
ResourceUtilities.cs (2)
70code = message.Substring(i, 7); 113code = message.Substring(i, k - i);
XMake.cs (3)
2089switchName = unquotedCommandLineArg.Substring(switchIndicatorsLength, switchParameterIndicator - switchIndicatorsLength); 2166string unquotedSwitchIndicatorAndName = QuotingUtilities.Unquote(commandLineArg.Substring(0, quotedSwitchParameterIndicator), out var doubleQuotesRemovedFromSwitchIndicatorAndName); 4574toolsVersionList = toolsVersionList.Substring(0, toolsVersionList.Length - 2);
MSBuildTaskHost (9)
AssemblyNameExtension.cs (2)
592string nameThis = asString1.Substring(0, baseLenThis); 593string nameThat = asString2.Substring(0, baseLenThat);
FileUtilities.cs (4)
258return FixFilePath(path.Substring(start, stop - start)); 289path = path.Substring(0, path.Length - 1); 338path = $"{targetQuote}{path.Substring(1, path.Length - 2)}{targetQuote}"; 405return FixFilePath(fullPath.Substring(0, i));
InterningWriteTranslator.cs (1)
146string directory = str.Substring(0, splitId + 1);
ResourceUtilities.cs (2)
70code = message.Substring(i, 7); 113code = message.Substring(i, k - i);
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)); 704sourceFileInfo.RelativeSourceFilePath = file.Path.Substring(0, fileExtIndex); 1414isValid = IsValidCLRNamespace(subClassFullName.Substring(0, index), false) && 1442ns = className.Substring(0, index); 2314genericName = genericName.Substring(0, bang); 2357genericName = genericName.Substring(0, bang); 2510string 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\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\BamlMapTable.cs (1)
1165typeClrNamespace = typeFullName.Substring(0, dotIndex);
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\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\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\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\XamlReaderHelper.cs (3)
1660ownerName = longName.Substring(0, idx); 2492return _text.Substring(_start, _current - _start); 3056prefix = attribData.Args.Substring(0, colonIndex);
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\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\TokenizerHelper.cs (1)
92return _str.Substring(_currentTokenIndex,_currentTokenLength);
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); 8171string imageXaml = dnImage.Xaml.Substring(0, uriSourceIndex); 8333pictureUri = instructionName.Substring(uriIndex, instructionName.Length - uriIndex - 1); 8338pictureUri = pictureUri.Substring(0, pictureUriEndIndex); 8390string param = instr.Substring(iStart, iEnd - iStart); 8600string name = instr.Substring(iStart, i - iStart); 11361string subtext = text.Substring(nStart, nEnd - nStart);
System\windows\Documents\TextEditor.cs (4)
1194textData = textData.Substring(0, splitPosition); 1200textData = textData.Substring(0, extraCharsAllowed-1); 1234textData = textData.Substring(0, endOfFirstLine); 1239textData = 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)
573name = name.Substring(1, name.Length-2); 580string ownerName = name.Substring(0, lastIndex).Trim(); 837nsPrefix = 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)
567str = 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);
Roslyn.Diagnostics.Analyzers (1)
src\RoslynAnalyzers\Utilities\Compiler\WellKnownTypeProvider.cs (1)
222namespaceNamesBuilder.Add(fullTypeName[prevStartIndex..i]);
Roslyn.Diagnostics.CSharp.Analyzers (1)
NumberCommentsRefactoring.cs (1)
92var separatedNumbers = text[commentStartIndex..eolOrEofIndex];
Roslyn.Test.Performance.Utilities (2)
RelativeDirectory.cs (1)
83return _workingDir.Substring(0, configurationIndex + configuration.Length);
VsPerfTest.cs (1)
108public override string Name => _testTemplateName.Substring(0, _testTemplateName.IndexOf("Template.xml"));
Roslyn.VisualStudio.Next.UnitTests (1)
UnifiedSettings\TestModel\Utilities.cs (1)
26var resourcesIdentifier = resourceReference.Substring(1, resourceReference.IndexOf(";") - 1);
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);
Sockets.FunctionalTests (1)
src\Servers\Kestrel\test\FunctionalTests\UnixDomainSocketsTests.cs (1)
190var httpStatus = int.Parse(httpResponse.Substring(httpStatusStart, httpStatusEnd - httpStatusStart), CultureInfo.InvariantCulture);
Swaggatherer (3)
src\Shared\CommandLineUtils\CommandLine\AnsiConsole.cs (1)
84var text = message.Substring(escapeScan, escapeIndex - escapeScan);
src\Shared\CommandLineUtils\CommandLine\CommandOption.cs (1)
40ValueName = part.Substring(1, part.Length - 2);
SwaggathererApplication.cs (1)
258return text.Substring(0, length);
System.CodeDom (10)
Microsoft\CSharp\CSharpCodeGenerator.cs (2)
2780sb.Append(CreateEscapedIdentifier(baseType.Substring(lastIndex, i - lastIndex))); 2787sb.Append(CreateEscapedIdentifier(baseType.Substring(lastIndex, i - lastIndex)));
Microsoft\VisualBasic\VBCodeGenerator.cs (3)
2397value = value.Substring(1, value.Length - 2); 2489sb.Append(CreateEscapedIdentifier(baseType.Substring(lastIndex, i - lastIndex))); 2496sb.Append(CreateEscapedIdentifier(baseType.Substring(lastIndex, i - lastIndex)));
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); 393result = typeName.Substring(start, index - start);
System.ComponentModel.Composition (1)
System\ComponentModel\Composition\ContractNameServices.cs (1)
331genericName = 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\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)
1067t = 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)
2154group = 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\libraries\Common\src\System\Text\EncodingHelper.Unix.cs (1)
58locale.Substring(dotPos, atPos - dotPos); // has modifier
System\TermInfo.cs (1)
177string printfFormat = format.Substring(pos - 1, printfEnd - pos + 2); // extract the format string
System.Data.Common (9)
src\libraries\Common\src\System\Data\Common\AdapterUtil.cs (2)
179unquotedString = quotedString.Substring(prefixLength, quotedStringLength - (prefixLength + suffixLength)).Replace(quoteSuffix + quoteSuffix, quoteSuffix); 183unquotedString = quotedString.Substring(prefixLength, quotedStringLength - prefixLength);
src\libraries\Common\src\System\Data\Common\DbConnectionOptions.Common.cs (2)
461keyvalue = keyvalue.Substring(1, keyvalue.Length - 2).Replace("\"\"", "\""); 464keyvalue = 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)
2785prefix = QualifiedTableName.Substring(0, QualifiedTableName.IndexOf(':'));
System.Data.Odbc (7)
src\libraries\Common\src\System\Data\Common\AdapterUtil.cs (2)
179unquotedString = quotedString.Substring(prefixLength, quotedStringLength - (prefixLength + suffixLength)).Replace(quoteSuffix + quoteSuffix, quoteSuffix); 183unquotedString = quotedString.Substring(prefixLength, quotedStringLength - prefixLength);
src\libraries\Common\src\System\Data\Common\DbConnectionOptions.Common.cs (2)
461keyvalue = keyvalue.Substring(1, keyvalue.Length - 2).Replace("\"\"", "\""); 464keyvalue = 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.Diagnostics.DiagnosticSource (15)
System\Diagnostics\Activity.cs (3)
1361return id.Substring(3, 32); 1370return id.Substring(rootStart, rootEnd - rootStart); 1398return 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) + "'"); 368eventSource.Message("DiagnosticSource: Parsing Explicit Transform '" + filterAndPayloadSpec.Substring(specStartIdx, endIdx - specStartIdx) + "'"); 618_outputName = transformSpec.Substring(startIdx, equalsIdx - startIdx); 630string propertyName = transformSpec.Substring(idIdx, endIdx - idIdx);
System\Diagnostics\LegacyPropagator.cs (2)
172WebUtility.UrlDecode(baggageString.Substring(keyStart, keyEnd - keyStart)).Trim(s_trimmingSpaceCharacters), 173WebUtility.UrlDecode(baggageString.Substring(valueStart, currentIndex - valueStart)).Trim(s_trimmingSpaceCharacters)));
System\Diagnostics\Metrics\MetricsEventSource.cs (1)
690spec.MeterName.Substring(0, spec.MeterName.Length - 1));
System.Diagnostics.Process (7)
src\libraries\Common\src\Interop\Linux\cgroups\Interop.cgroups.cs (4)
376string[] lineParts = line.Substring(0, endOfOptionalFields).Split(' '); 436if (Array.IndexOf(line[lineParts[1]].Split(','), subsystem) < 0) 442path = line[lineParts[2]]; 452path = line[lineParts[2]];
src\libraries\Common\src\System\IO\StringParser.cs (3)
90return _buffer.Substring(_startIndex, _endIndex - _startIndex); 118string result = _buffer.Substring(_startIndex + 1, lastParen - _startIndex - 1); 133return _buffer.Substring(_startIndex, _endIndex - _startIndex);
System.Drawing.Primitives (4)
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\libraries\Common\src\System\IO\PathInternal.cs (1)
221path!.Substring(0, path.Length - 1) :
System.IO.FileSystem.Watcher (1)
src\libraries\Common\src\System\IO\PathInternal.cs (1)
221path!.Substring(0, path.Length - 1) :
System.IO.Packaging (11)
System\IO\Packaging\InternalRelationshipCollection.cs (1)
599return string.Concat("R", Guid.NewGuid().ToString("N").Substring(0, TimestampLength));
System\IO\Packaging\PackUriHelper.cs (3)
212partName = partName.Substring(0, partName.Length - file.Length); 268path = path.Substring(0, path.Length - partNameWithoutExtension.Length - RelationshipPartExtensionName.Length - 1); 273path = 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.Memory (1)
System\Buffers\ReadOnlySequence.cs (1)
498return text.Substring(start, length);
System.Net.Http (37)
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)
134encoding = Encoding.GetEncoding(charset.Substring(1, charset.Length - 2));
System\Net\Http\SocketsHttpHandler\AuthenticationHelper.Digest.cs (1)
311return data.Substring(start, length);
System\Net\Http\SocketsHttpHandler\HttpConnectionPoolManager.cs (2)
241return hostHeader.Substring(0, colonPos); 248return hostHeader.Substring(0, colonPos);
System\Net\Http\SocketsHttpHandler\HttpEnvironmentProxy.cs (4)
81value = value.Substring(0, idx); 87domain = value.Substring(0, idx); 185user = auth.Substring(0, separatorIndex); 199host = 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\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)
78username = 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)
147displayName = displayName.Substring(1, displayName.Length - 2);
System\Net\Mail\MailAddressParser.cs (3)
240domain = data.Substring(index + 1, startingIndex - index); 328localPart = data.Substring(index + 1, startingIndex - index); 386displayName = data.Substring(leftIndex, firstNonCommentIndex - leftIndex);
System\Net\Mail\MailBnfHelper.cs (1)
245return data.Substring(start, i);
System\Net\Mime\MimeBasePart.cs (1)
107return Encoding.GetEncoding(value[subStrings[1]]);
System.Net.NetworkInformation (10)
src\libraries\Common\src\System\IO\RowConfigReader.cs (1)
116value = _buffer.Substring(valueIndex, valueLength); // Grab the whole value string.
src\libraries\Common\src\System\IO\StringParser.cs (3)
90return _buffer.Substring(_startIndex, _endIndex - _startIndex); 118string result = _buffer.Substring(_startIndex + 1, lastParen - _startIndex - 1); 133return _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\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)
201string sendCommand = _commands[_index].Command.Substring(0, _commands[_index].Command.Length - 2); 614_buffer = szResponse.Substring(szResponse.Length - unusedChars, unusedChars); 658state.Resp.StatusDescription = responseString.Substring(0, completeLength); 661if (NetEventSource.Log.IsEnabled()) NetEventSource.Info(this, $"Received response: {responseString.Substring(0, completeLength - 2)}");
System\Net\FtpControlStream.cs (7)
785path = path.Substring(0, path.Length - 1); 797directory = path.Substring(0, index + 1); 803directory = directory.Substring(0, directory.Length - 1); 1044return str.Substring(firstQuote + 1, lastQuote - firstQuote - 1); 1087string addressInfo = responseString.Substring(pos1 + 1, pos2 - pos1 - 1); 1198response.StatusCodeString = responseString.Substring(0, 3); 1235if (responseString.Substring(lineStart, 3) == response.StatusCodeString)
System\Net\HttpWebRequest.cs (1)
1559if (!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)
319string name = header.Substring(0, colpos);
System.Private.CoreLib (31)
src\libraries\Common\src\System\IO\StringParser.cs (3)
90return _buffer.Substring(_startIndex, _endIndex - _startIndex); 118string result = _buffer.Substring(_startIndex + 1, lastParen - _startIndex - 1); 133return _buffer.Substring(_startIndex, _endIndex - _startIndex);
src\libraries\System.Private.CoreLib\src\System\Environment.GetFolderPathCore.Unix.cs (1)
234line.Substring(pos, endPos - pos);
src\libraries\System.Private.CoreLib\src\System\Environment.Unix.cs (1)
23return dotPos < 0 ? hostName : hostName.Substring(0, dotPos);
src\libraries\System.Private.CoreLib\src\System\Environment.UnixOrBrowser.cs (1)
33string key = name.Substring(lastPos + 1, pos - lastPos - 1);
src\libraries\System.Private.CoreLib\src\System\Globalization\CalendarData.cs (1)
302this.saAbbrevEraNames[0] = this.saEraNames[0].Substring(2, 2);
src\libraries\System.Private.CoreLib\src\System\Globalization\CultureData.cs (2)
2037return str.Substring(start, end - start + 1); 2182result[index++] = digits.Substring(start, ffffPos - start);
src\libraries\System.Private.CoreLib\src\System\Globalization\CultureData.Icu.cs (1)
167_sName = collationStart < 0 || _bNeutral ? _sRealName : _sRealName.Substring(0, collationStart);
src\libraries\System.Private.CoreLib\src\System\Globalization\CultureInfo.cs (1)
287culture = new CultureInfo(name.Substring(0, idx));
src\libraries\System.Private.CoreLib\src\System\Globalization\IdnMapping.cs (2)
190unicode = unicode.Substring(index, count); 546ascii = ascii.Substring(index, count);
src\libraries\System.Private.CoreLib\src\System\Globalization\JapaneseCalendar.Icu.cs (1)
136return eraNames[eraIndex].Substring(0, 1);
src\libraries\System.Private.CoreLib\src\System\Globalization\StringInfo.cs (1)
127return str.Substring(index, nextTextElementLength);
src\libraries\System.Private.CoreLib\src\System\Globalization\TextElementEnumerator.cs (1)
62currentSubstr = _str.Substring(_currentTextElementOffset, _currentTextElementLength);
src\libraries\System.Private.CoreLib\src\System\IO\FileSystemInfo.cs (1)
56return FullPath.Substring(i, length - i);
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\libraries\System.Private.CoreLib\src\System\IO\StringReader.cs (1)
190string result = s.Substring(pos, foundLineLength);
src\libraries\System.Private.CoreLib\src\System\Memory.cs (1)
212return (_object is string str) ? str.Substring(_index, _length) : Span.ToString();
src\libraries\System.Private.CoreLib\src\System\ReadOnlyMemory.cs (1)
141return (_object is string str) ? str.Substring(_index, _length) : Span.ToString();
src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\SymbolType.cs (1)
254_format = format.Substring(curIndex, length);
src\libraries\System.Private.CoreLib\src\System\String.Manipulation.cs (1)
1188return Substring(0, startIndex);
src\libraries\System.Private.CoreLib\src\System\TimeZoneInfo.Unix.cs (1)
1108zoneAbbreviations.Substring(index, lastIndex - index) :
src\libraries\System.Private.CoreLib\src\System\TimeZoneInfo.Unix.NonAndroid.cs (1)
205timeZoneId = zoneTabFileLine.Substring(startIndex, length);
src\libraries\System.Reflection.Metadata\src\System\Reflection\Metadata\TypeName.cs (1)
187_fullName = _fullName.Substring(0, _nestedNameLength);
src\System\Exception.CoreCLR.cs (1)
281helpFile = helpFile.Substring(0, poundPos);
src\System\Reflection\Emit\RuntimeModuleBuilder.cs (1)
611baseName = className.Substring(0, i);
src\System\Reflection\Emit\RuntimeTypeBuilder.cs (1)
427m_strNameSpace = name.Substring(0, iLast);
src\System\RuntimeType.CoreCLR.cs (1)
2038ns = fullname.Substring(0, nsDelimiter);
System.Private.DataContractSerialization (17)
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); 393result = typeName.Substring(start, index - start);
System\Runtime\Serialization\DataContract.cs (4)
1484typeName = typeName.Substring(0, iParam); 1688ns = fullTypeName.Substring(0, nsEnd); 1693localName = localName.Substring(0, iParam); 1913throw 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)
446prefix = 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)
915pathSegments.Add(path.Substring(current, (next - current) + 1)); 978? _string.Substring(start + 1, _info.Offset.Query - start - 1) 979: _string.Substring(start, _info.Offset.Query - start); 1189host.Substring(1, host.Length - 2); 2122_string = _string.Substring(0, idx); 2140_string = _string.Substring(0, idx); 2541host = str.Substring(idx, end - idx); 3020return _string.Substring(_info.Offset.Scheme, _info.Offset.Path - _info.Offset.Scheme); 3033return _string.Substring(_info.Offset.Host, _info.Offset.Path - _info.Offset.Host); 3043return _string.Substring(_info.Offset.Scheme, _info.Offset.End - _info.Offset.Scheme); 3056return _string.Substring(_info.Offset.Scheme, _info.Offset.Fragment - _info.Offset.Scheme); 3060return _string.Substring(_info.Offset.Scheme, _info.Offset.Path - _info.Offset.Scheme); 3067return _string.Substring(_info.Offset.Scheme, _info.Offset.Fragment - _info.Offset.Scheme); 3073return _string.Substring(_info.Offset.Scheme, _info.Offset.User - _info.Offset.Scheme); 3086return (idx - _info.Offset.Host == 0) ? string.Empty : _string.Substring(_info.Offset.Host, 3102return _string.Substring(delimiterAwareIdx, _info.Offset.Query - delimiterAwareIdx); 3114return _string.Substring(delimiterAwareIdx, _info.Offset.Fragment - delimiterAwareIdx); 3126return _string.Substring(delimiterAwareIdx, _info.Offset.End - delimiterAwareIdx); 3130_string.Substring(_info.Offset.User, _info.Offset.Path - _info.Offset.User); 3140return _string.Substring(_info.Offset.Path, _info.Offset.Fragment - _info.Offset.Path); 3152return _string.Substring(_info.Offset.Scheme, _info.Offset.End - _info.Offset.Scheme); 3155return _string.Substring(_info.Offset.Path, _info.Offset.End - _info.Offset.Path); 3171return _string.Substring(_info.Offset.User, delimiterAwareIdx - _info.Offset.User); 3802newHost = _originalUnicodeString.Substring(0, startInput);
System\UriBuilder.cs (3)
86_query = extraValue.Substring(0, fragmentIndex); 122value = value.Substring(0, index); 297_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)
9646return value.Substring(startPos, i - startPos); 9665return (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)
321string? choiceNs = colon < 0 ? choiceMapping.Namespace : xmlName.Substring(0, colon);
System\Xml\Serialization\Types.cs (3)
986name = name.Substring(0, arity); 1400ns = type.Substring(0, nsLen); 1408name = type.Substring(nsLen + 1, nameLen - nsLen - 1);
System\Xml\Serialization\XmlReflectionImporter.cs (3)
2004if (xmlName.Substring(0, xmlName.Length - 1) == anyNs) 2013string? choiceNs = colon < 0 ? choiceMapping.Namespace : xmlName.Substring(0, colon); 2137string choiceNs = colon < 0 ? "" : choiceId.Substring(0, colon);
System\Xml\Serialization\XmlSerializationReader.cs (3)
799attr.Value = $"{_r.LookupNamespace(attr.Value.Substring(0, colon))}:{attr.Value.AsSpan(colon + 1)}"; 1142string? prefix = colon < 0 ? null : value!.Substring(0, colon); 1907xsiTypeNs = Reader.LookupNamespace((colon >= 0) ? value.Substring(0, colon) : "");
System\Xml\Serialization\XmlSerializationReaderILGen.cs (2)
2748LocalBuilder localA = ilg.GetLocal(source.Substring(0, index)); 2818LocalBuilder localA = ilg.GetLocal(source.Substring(0, index));
System\Xml\Serialization\XmlSerializationWriter.cs (2)
976string prefix = localName.Substring(0, colon); 1761string assemblyName = (iComma > -1) ? assemblyFullName.Substring(0, iComma) : assemblyFullName;
System\Xml\Serialization\XmlSerializationWriterILGen.cs (1)
2259string? 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)); 507string 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)
1023return 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\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)
272parentName = 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)
219ns = fullName.Substring(0, indexOfLastDot);
System\Reflection\TypeLoading\RuntimeTypeInfo.GetMember.cs (1)
36string prefix = optionalNameOrPrefix!.Substring(0, optionalNameOrPrefix.Length - 1);
System.Runtime.Serialization.Schema (2)
System\Runtime\Serialization\Schema\CodeExporter.cs (2)
477string containingTypeName = originalName.Substring(0, nestedTypeIndex); 1444identifier = 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); 341idref = 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.Text.Encoding.CodePages (1)
System\Text\EncodingTable.cs (1)
211name = names.Substring(indices[i], indices[i + 1] - indices[i]);
System.Text.Json (1)
System\Text\Json\ThrowHelper.Serialization.cs (1)
445message = $"{message.Substring(0, iPos)} Path: {path} |{message.Substring(iPos)}";
System.Text.Json.SourceGeneration (1)
JsonSourceGenerator.Emitter.cs (1)
1119contextTypeName = contextTypeName.Substring(0, backTickIndex);
System.Text.RegularExpressions (7)
System\Text\RegularExpressions\Capture.cs (1)
30public string Value => Text is string text ? text.Substring(Index, Length) : string.Empty;
System\Text\RegularExpressions\Regex.Split.cs (3)
95state.results.Add(state.input.Substring(state.prevat, match.Index - state.prevat)); 123state.results.Add(state.input.Substring(match.Index + match.Length, state.prevat - match.Index - match.Length)); 143state.results.Add(input.Substring(0, state.prevat));
System\Text\RegularExpressions\RegexParser.cs (3)
1429return _pattern.Substring(startpos, _pos - startpos); 1642string capname = _pattern.Substring(startpos, _pos - startpos); 2022_concatenation!.AddChild(new RegexNode(RegexNodeKind.Multi, _options & ~RegexOptions.IgnoreCase, _pattern.Substring(pos, cch)));
System.Text.RegularExpressions.Generator (3)
src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexParser.cs (3)
1429return _pattern.Substring(startpos, _pos - startpos); 1642string capname = _pattern.Substring(startpos, _pos - startpos); 2022_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)
948get => 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)
587string line = text[lineStart..lineEnd]; 966return 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.Windows.Forms.UI.IntegrationTests (4)
Infra\SendInput.cs (1)
45inputSimulator.Keyboard.TextEntry(text[index..nextIndex]);
RichTextBoxTests.cs (3)
56Assert.Equal(result.LinkText, richTextBox.Text.Substring(result.LinkStart, result.LinkLength)); 116Assert.Equal(result.LinkText, richTextBox.Text.Substring(result.LinkStart, result.LinkLength)); 177Assert.Equal(result.LinkText, richTextBox.Text.Substring(result.LinkStart, result.LinkLength));
System.Xaml (10)
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);
TagHelpersWebSite (1)
TagHelpers\CustomEncoderTagHelper.cs (1)
59output.Write(value.Substring(startIndex, characterCount));
Templates.Blazor.Tests (4)
src\ProjectTemplates\Shared\ProjectFactoryFixture.cs (1)
33var projectKey = Guid.NewGuid().ToString().Substring(0, 10).ToLowerInvariant();
src\Shared\CertificateGeneration\UnixCertificateManager.cs (1)
341? Path.Combine("$HOME", certDir[homeDirectoryWithSlash.Length..])
src\Shared\CommandLineUtils\CommandLine\AnsiConsole.cs (1)
84var text = message.Substring(escapeScan, escapeIndex - escapeScan);
src\Shared\CommandLineUtils\CommandLine\CommandOption.cs (1)
40ValueName = part.Substring(1, part.Length - 2);
Templates.Blazor.WebAssembly.Auth.Tests (4)
src\ProjectTemplates\Shared\ProjectFactoryFixture.cs (1)
33var projectKey = Guid.NewGuid().ToString().Substring(0, 10).ToLowerInvariant();
src\Shared\CertificateGeneration\UnixCertificateManager.cs (1)
341? Path.Combine("$HOME", certDir[homeDirectoryWithSlash.Length..])
src\Shared\CommandLineUtils\CommandLine\AnsiConsole.cs (1)
84var text = message.Substring(escapeScan, escapeIndex - escapeScan);
src\Shared\CommandLineUtils\CommandLine\CommandOption.cs (1)
40ValueName = part.Substring(1, part.Length - 2);
Templates.Blazor.WebAssembly.Tests (4)
src\ProjectTemplates\Shared\ProjectFactoryFixture.cs (1)
33var projectKey = Guid.NewGuid().ToString().Substring(0, 10).ToLowerInvariant();
src\Shared\CertificateGeneration\UnixCertificateManager.cs (1)
341? Path.Combine("$HOME", certDir[homeDirectoryWithSlash.Length..])
src\Shared\CommandLineUtils\CommandLine\AnsiConsole.cs (1)
84var text = message.Substring(escapeScan, escapeIndex - escapeScan);
src\Shared\CommandLineUtils\CommandLine\CommandOption.cs (1)
40ValueName = part.Substring(1, part.Length - 2);
Templates.Mvc.Tests (4)
src\ProjectTemplates\Shared\ProjectFactoryFixture.cs (1)
33var projectKey = Guid.NewGuid().ToString().Substring(0, 10).ToLowerInvariant();
src\Shared\CertificateGeneration\UnixCertificateManager.cs (1)
341? Path.Combine("$HOME", certDir[homeDirectoryWithSlash.Length..])
src\Shared\CommandLineUtils\CommandLine\AnsiConsole.cs (1)
84var text = message.Substring(escapeScan, escapeIndex - escapeScan);
src\Shared\CommandLineUtils\CommandLine\CommandOption.cs (1)
40ValueName = part.Substring(1, part.Length - 2);
Templates.Tests (4)
src\ProjectTemplates\Shared\ProjectFactoryFixture.cs (1)
33var projectKey = Guid.NewGuid().ToString().Substring(0, 10).ToLowerInvariant();
src\Shared\CertificateGeneration\UnixCertificateManager.cs (1)
341? Path.Combine("$HOME", certDir[homeDirectoryWithSlash.Length..])
src\Shared\CommandLineUtils\CommandLine\AnsiConsole.cs (1)
84var text = message.Substring(escapeScan, escapeIndex - escapeScan);
src\Shared\CommandLineUtils\CommandLine\CommandOption.cs (1)
40ValueName = part.Substring(1, part.Length - 2);
Test.Utilities (1)
src\RoslynAnalyzers\Utilities\Compiler\WellKnownTypeProvider.cs (1)
222namespaceNamesBuilder.Add(fullTypeName[prevStartIndex..i]);
TestTasks (1)
InjectRequestHandler.cs (1)
60var bitnessString = rid.Substring(rid.Length - 3, 3);
Text.Analyzers (1)
src\RoslynAnalyzers\Utilities\Compiler\WellKnownTypeProvider.cs (1)
222namespaceNamesBuilder.Add(fullTypeName[prevStartIndex..i]);
TlsFeaturesObserve (1)
HttpSys\HttpSysConfigurator.cs (1)
80bytes[i / 2] = Convert.ToByte(thumbprint.Substring(i, 2), 16);
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)));
VBCSCompiler.UnitTests (1)
ServerUtil.cs (1)
171internal static string GetPipeName() => Guid.NewGuid().ToString().Substring(0, 10);
VisualBasicSyntaxGenerator (6)
Grammar\GrammarGenerator.vb (1)
333Dim trimmed = If(name.EndsWith("Syntax"), name.Substring(0, name.Length - "Syntax".Length), name)
Util\WriteUtils.vb (4)
57Return nodeStructure.Name.Substring(0, nodeStructure.Name.Length - 6) 452If nodeName.EndsWith("Syntax", StringComparison.Ordinal) Then nodeName = nodeName.Substring(0, nodeName.Length - 6) 564Dim split As Integer = text.Substring(0, LineLength).LastIndexOf(" "c) 567Dim line As String = text.Substring(0, split).Trim()
Util\XmlRenamer.vb (1)
59s = s.Substring(1, s.Length - 2)
Wasm.Performance.ConsoleHost (2)
src\Shared\CommandLineUtils\CommandLine\AnsiConsole.cs (1)
84var text = message.Substring(escapeScan, escapeIndex - escapeScan);
src\Shared\CommandLineUtils\CommandLine\CommandOption.cs (1)
40ValueName = part.Substring(1, part.Length - 2);
WinFormsControlsTest (1)
RichTextBoxes.cs (1)
63string content = control.Text.Substring(e.LinkStart, e.LinkLength);
XmlFileLogger (3)
ItemGroupParser.cs (2)
60name = line.Substring(4, line.Length - 5); 88var name = nameEqualsValue.Substring(0, equals);
ObjectModel\Build.cs (1)
121var name = message.Substring(0, equals);
xunit.assert (2)
Sdk\ArgumentFormatter.cs (2)
442 var displayed = value.Substring(0, MAX_STRING_LENGTH); 523 result = result.Substring(0, tickIdx);
xunit.console (4)
common\AssemblyResolution\Microsoft.DotNet.PlatformAbstractions\Native\PlatformApis.cs (1)
137distroInfo.VersionId = distroInfo.VersionId.Substring(0, minorVersionNumberSeparatorIndex);
common\AssemblyResolution\Microsoft.Extensions.DependencyModel\DependencyContextJsonReader.cs (2)
80framework = runtimeTargetName.Substring(0, seperatorIndex); 375var name = Pool(nameWithVersion.Substring(0, seperatorPosition));
ConsoleRunner.cs (1)
257transform => Console.WriteLine($" -{$"{transform.CommandLine} <filename>".PadRight(21).Substring(0, 21)} : {transform.Description}")