207 writes to Length
aspire (9)
Utils\Markdown\MarkdownToSpectreConverter.cs (1)
88builder.Length--;
Utils\Markdown\MarkdownToSpectreConverter.Markup.cs (8)
69builder.Length = blockStart; 141contentBuilder.Length = childStart; 250builder.Length--; 302builder.Length = blockStart; 355builder.Length = itemStart; 383builder.Length = blockStart; 396builder.Length = blockStart; 411builder.Length = blockStart;
Aspire.Hosting (1)
Dcp\ResourceLogSource.cs (1)
177sb.Length--;
dotnet-svcutil-lib (13)
FrameworkFork\Microsoft.Xml\Xml\BufferBuilder.cs (2)
280_stringBuilder.Length = 0; 541_stringBuilder.Length = newLength;
FrameworkFork\Microsoft.Xml\Xml\Core\XmlTextEncoder.cs (2)
74_attrValue.Length = 0; 83_attrValue.Length = 0;
FrameworkFork\Microsoft.Xml\Xml\Core\XmlWellformedWriterHelpers.cs (1)
494_stringValue.Length = 0;
FrameworkFork\Microsoft.Xml\Xml\schema\dtdvalidator.cs (2)
232textValue.Length = 0; 284textValue.Length = 0; // cleanup
FrameworkFork\Microsoft.Xml\Xml\schema\xdrvalidator.cs (2)
184textValue.Length = 0; // cleanup 324textValue.Length = 0;
FrameworkFork\Microsoft.Xml\Xml\schema\XmlSchemaValidator.cs (1)
2122_textValue.Length = 0;
FrameworkFork\Microsoft.Xml\Xml\schema\XsdDuration.cs (2)
460sb.Length += 9; 474sb.Length = zeroIdx + 1;
FrameworkFork\Microsoft.Xml\Xml\schema\xsdvalidator.cs (1)
574textValue.Length = 0;
GenerateDocumentationAndConfigFiles (2)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\WordParser.cs (2)
294_buffer.Length = 0; 604_buffer.Length--;
ILCompiler.TypeSystem (1)
src\runtime\src\coreclr\tools\Common\TypeSystem\Common\Utilities\DebugNameFormatter.cs (1)
173sb.Length = initialLen;
Microsoft.AspNetCore.Authentication.Twitter (3)
TwitterHandler.cs (3)
221stringBuilder.Length--; 243stringBuilder.Length--; 253stringBuilder.Length--;
Microsoft.AspNetCore.JsonPatch (1)
Internal\ParsedPath.cs (1)
54sb.Length = 0;
Microsoft.AspNetCore.JsonPatch.SystemTextJson (1)
Internal\ParsedPath.cs (1)
49sb.Length = 0;
Microsoft.AspNetCore.Mvc.Core (1)
Routing\UrlHelperBase.cs (1)
389builder.Length--;
Microsoft.AspNetCore.Mvc.Razor (1)
RazorFileHierarchy.cs (1)
31builder.Length = index + 1;
Microsoft.AspNetCore.Routing (1)
UriBuildingContext.cs (1)
138_path.Length = _lastValueOffset;
Microsoft.Build (3)
Evaluation\ParserIgnoreConfiguration.cs (1)
157sb.Length--;
Logging\BaseConsoleLogger.cs (1)
1251shared.Length = 0;
Logging\BinaryLogger\BuildEventArgsReader.cs (1)
1958stringBuilder!.Length = position.StringLength;
Microsoft.Build.Framework (2)
FileUtilities.cs (1)
1391sb.Length--;
ReuseableStringBuilder.cs (1)
61_borrowedBuilder.Length = value;
Microsoft.Build.Tasks.CodeAnalysis (2)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\CommandLineUtilities.cs (2)
65builder.Length = 0; 85builder.Length = 0;
Microsoft.Build.Tasks.Core (3)
GenerateResource.cs (3)
3687name.Length = 0; 3711name.Length--; 3722value.Length = 0;
Microsoft.CodeAnalysis (5)
CommandLine\CommandLineParser.cs (2)
608stringBuilder.Builder.Length = 0; 626stringBuilder.Builder.Length = 0;
InternalUtilities\CommandLineUtilities.cs (2)
65builder.Length = 0; 85builder.Length = 0;
Syntax\SyntaxDiffer.cs (1)
837builder.Length = 0;
Microsoft.CodeAnalysis.Analyzers (2)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\WordParser.cs (2)
294_buffer.Length = 0; 604_buffer.Length--;
Microsoft.CodeAnalysis.AnalyzerUtilities (2)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\WordParser.cs (2)
294_buffer.Length = 0; 604_buffer.Length--;
Microsoft.CodeAnalysis.CSharp (3)
Parser\Lexer_RawStringLiteral.cs (1)
53_builder.Length = 0;
Parser\Lexer_StringLiteral.cs (2)
36_builder.Length = 0; 195_builder.Length = 0;
Microsoft.CodeAnalysis.NetAnalyzers (2)
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\Compiler\WordParser.cs (2)
293_buffer.Length = 0; 603_buffer.Length--;
Microsoft.CodeAnalysis.ResxSourceGenerator (2)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\WordParser.cs (2)
294_buffer.Length = 0; 604_buffer.Length--;
Microsoft.CodeAnalysis.VisualBasic (1)
Scanner\ScannerInterpolatedString.vb (1)
220valueBuilder.Length -= pendingWhitespace
Microsoft.DotNet.Cli.Definitions (1)
Help\HelpBuilder.cs (1)
369sb.Length--;
Microsoft.Maui.Controls (2)
Shapes\PathFigureCollectionConverter.cs (2)
666 sb.Length--; 670 sb.Length--;
Microsoft.Maui.Controls.Xaml (1)
MarkupExpressionParser.cs (1)
229 piece.Length--;
Microsoft.ML.Core (4)
CommandLine\CmdLexer.cs (2)
365sb.Length = ich + cch; 459sb.Length = ichDst;
CommandLine\CmdParser.cs (2)
809sb.Length = ich; 824sb.Length = ich;
Microsoft.ML.Data (6)
DataLoadSave\Text\TextLoader.cs (2)
213sb.Length = ich; 226sb.Length = ich;
Transforms\ColumnConcatenatingTransformer.cs (1)
663sb.Length = len;
Transforms\KeyToVector.cs (1)
416sb.Length = len;
Transforms\SlotsDroppingTransformer.cs (1)
108sb.Length = ich;
Transforms\TypeConverting.cs (1)
116sb.Length = ich;
Microsoft.ML.Transforms (9)
Expression\Lexer.cs (7)
216_sb.Length = 0; 271_sb.Length = 0; 461_sb.Length = 0; 680_sb.Length = 0; 731_sb.Length = 0; 742_sb.Length = 0; 835_sb.Length = 0;
KeyToVectorMapping.cs (1)
326sb.Length = len;
Text\TokenizingByCharacters.cs (1)
318bldr.Length = 0;
Microsoft.TemplateEngine.Cli (2)
Commands\CommandLineUtils.cs (2)
47sb.Length--; 107sb.Length--;
Microsoft.TestPlatform.CommunicationUtilities (2)
Json\Jsonite\Jsonite.cs (2)
576builder.Length = 0; 675builder.Length = 0;
Microsoft.VisualStudio.TestPlatform.Common (7)
Utilities\SimpleJSON.cs (7)
475sb.Length = 0; 515sb.Length = 0; 560token.Length = 0; 578token.Length = 0; 601token.Length = 0; 613token.Length = 0; 634token.Length = 0;
Microsoft.VisualStudio.TestPlatform.Extensions.Trx.TestLogger (1)
Utility\TrxFileHelper.cs (1)
77result.Length = fileName.Length;
Microsoft.Win32.Registry (2)
Microsoft\Win32\RegistryKey.cs (2)
1424sb.Length = temp; 1469path.Length += j - i;
NuGet.Packaging (1)
PackageCreation\Authoring\PackageBuilder.cs (1)
975warningMessage.Length -= Environment.NewLine.Length;
PresentationBuildTasks (2)
src\wpf\src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\MarkupExtensionParser.cs (2)
1187sb.Length = i+1; 1190sb.Length = 0;
PresentationCore (3)
System\Windows\Media\GlyphsSerializer.cs (2)
149sb.Length = trailingCharIndex + 1; 222_glyphStringBuider.Length = 0;
System\Windows\Media\mediaeventshelper.cs (1)
391Length = stringLength
PresentationFramework (5)
MS\Internal\Data\PathParser.cs (2)
329parenStringBuilder.Length = 0; 330valueStringBuilder.Length = 0;
MS\Internal\Globalization\BamlTreeUpdater.cs (1)
393textContent.Length = 0;
System\Windows\Markup\MarkupExtensionParser.cs (2)
1187sb.Length = i+1; 1190sb.Length = 0;
ReachFramework (3)
MS\Internal\Printing\Configuration\COMPSTUISRID.cs (1)
39resString.Length = Math.Max(0, Math.Min(charCount, resString.Length));
PrintSystemExceptions\PrintSystemException.cs (2)
280win32ErrorMessage.Length = 0; 286win32ErrorMessage.Length = charCount;
Roslyn.Diagnostics.Analyzers (2)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\WordParser.cs (2)
294_buffer.Length = 0; 604_buffer.Length--;
System.CommandLine (1)
Help\HelpBuilder.cs (1)
316sb.Length--;
System.Configuration.ConfigurationManager (2)
System\Configuration\StringAttributeCollection.cs (1)
69if (sb.Length > 0) sb.Length--;
System\Configuration\XmlUtil.cs (1)
929_cachedStringWriter.GetStringBuilder().Length = 0;
System.Console (1)
System\IO\StdInReader.cs (1)
199_readLineSB.Length = len - 1;
System.Data.Common (10)
src\runtime\src\libraries\Common\src\System\Data\Common\DbConnectionOptions.Common.cs (2)
199buffer.Length = 0; 249buffer.Length = 0;
src\runtime\src\libraries\Common\src\System\Data\Common\MultipartIdentifier.cs (3)
106sb.Length = 0; 120sb.Length = 0; 153whitespaceSB.Length = 0;
System\Data\xmlsaver.cs (5)
315builder.Length = 0; 1192builder.Length = 0; 2039encodedName.Length = 0; 2107encodedName.Length = 0; 2191encodedName.Length = 0;
System.Data.Odbc (6)
src\runtime\src\libraries\Common\src\System\Data\Common\DbConnectionOptions.Common.cs (2)
199buffer.Length = 0; 249buffer.Length = 0;
src\runtime\src\libraries\Common\src\System\Data\Common\MultipartIdentifier.cs (3)
106sb.Length = 0; 120sb.Length = 0; 153whitespaceSB.Length = 0;
System\Data\Odbc\OdbcMetaDataFactory.cs (1)
736scratchStringBuilder.Length = 0;
System.Data.OleDb (7)
DbConnectionOptions.cs (2)
552buffer.Length = 0; 602buffer.Length = 0;
OleDbMetaDataFactory.cs (2)
223patternEscaped.Length = 0; 333scratchStringBuilder.Length = 0;
src\runtime\src\libraries\Common\src\System\Data\Common\MultipartIdentifier.cs (3)
106sb.Length = 0; 120sb.Length = 0; 153whitespaceSB.Length = 0;
System.Diagnostics.Process (2)
System\Diagnostics\AsyncStreamReader.cs (2)
135_sb.Length = 0; 208_sb.Length = 0;
System.Diagnostics.TextWriterTraceListener (1)
System\Diagnostics\XmlWriterTraceListener.cs (1)
167_strBldr.Length = 0;
System.Net.HttpListener (4)
System\Net\Managed\ChunkStream.cs (2)
151_saved.Length = 0; 178_saved.Length = 0;
System\Net\Managed\HttpConnection.cs (1)
445_currentLine.Length = 0;
System\Net\Managed\HttpListenerResponse.Managed.cs (1)
333sb.Length = startingLength;
System.Net.Primitives (1)
System\Net\Cookie.cs (1)
702sb.Length = beforeLength;
System.Private.CoreLib (4)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\DateTimeFormatInfoScanner.cs (1)
300dateWord.Length = 0;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\StringBuilder.cs (2)
380this.Length = 0; 1012Length = 0;
System\Diagnostics\StackTrace.NativeAot.cs (1)
92builder.Length -= Environment.NewLine.Length;
System.Private.Xml (44)
System\Xml\Core\XmlTextEncoder.cs (2)
65_attrValue.Length = 0; 75_attrValue.Length = 0;
System\Xml\Core\XmlTextReaderImpl.cs (14)
2198_stringBuilder.Length = 0; 3641sb.Length = originalSbLen; 3654sb.Length = 0; 4284_stringBuilder.Length = 0; 5376_stringBuilder.Length = 0; 5457_stringBuilder.Length = 0; 5462_stringBuilder.Length = 0; 5500_stringBuilder.Length = 0; 5510_stringBuilder.Length = 0; 5798_stringBuilder.Length = 0; 5932_stringBuilder.Length = 0; 6300_stringBuilder.Length = 0; 6502_stringBuilder.Length = 0; 8730_stringBuilder.Length = 0;
System\Xml\Core\XmlTextReaderImplAsync.cs (11)
1208sb.Length = originalSbLen; 1221sb.Length = 0; 2883_stringBuilder.Length = 0; 3023_stringBuilder.Length = 0; 3028_stringBuilder.Length = 0; 3071_stringBuilder.Length = 0; 3085_stringBuilder.Length = 0; 3557_stringBuilder.Length = 0; 3698_stringBuilder.Length = 0; 4011_stringBuilder.Length = 0; 4227_stringBuilder.Length = 0;
System\Xml\Core\XmlWellFormedWriterHelpers.cs (1)
500_stringValue.Length = 0;
System\Xml\Schema\DtdParser.cs (1)
2404_stringBuilder.Length = 0;
System\Xml\Schema\DtdParserAsync.cs (1)
1850_stringBuilder.Length = 0;
System\Xml\Schema\DtdValidator.cs (2)
235textValue!.Length = 0; 287textValue!.Length = 0; // cleanup
System\Xml\Schema\XdrValidator.cs (2)
186textValue!.Length = 0; // cleanup 328textValue!.Length = 0;
System\Xml\Schema\XmlSchemaValidator.cs (1)
2092_textValue?.Length = 0;
System\Xml\Schema\XsdValidator.cs (1)
566textValue!.Length = 0;
System\Xml\Xsl\Runtime\DecimalFormatter.cs (1)
122temp.Length = 0;
System\Xml\Xsl\Xslt\QilGenerator.cs (1)
990_unescapedText.Length = 0;
System\Xml\Xsl\Xslt\QilStrConcatenator.cs (2)
30_builder.Length = 0; 40_builder.Length = 0;
System\Xml\Xsl\XsltOld\Compiler.cs (1)
907lex.Length = 0;
System\Xml\Xsl\XsltOld\Processor.cs (1)
287_sharedStringBuilder.Length = 0;
System\Xml\Xsl\XsltOld\ReaderOutput.cs (2)
698_buffer!.Length = 0; // clean buffer 708_buffer!.Length = 0; // clean buffer
System.ServiceModel.Primitives (1)
Internals\System\Runtime\Remoting\SoapHexBinary.cs (1)
27_sb.Length = 0;
System.Text.Json (1)
System\Text\Json\Serialization\Metadata\JsonTypeInfoResolverChain.cs (1)
67sb.Length -= 2;
System.Text.Json.SourceGeneration (2)
JsonSourceGenerator.Emitter.cs (2)
1738sb.Length -= 2; // delete the last ", " token 1751sb.Length -= 2; // delete the last ", " token
System.Windows.Forms (3)
System\Windows\Forms\Controls\DataGridView\DataGridView.Methods.cs (3)
7174sbContent.Length = 0; 7460sbContent.Length = 0; 7904sbContent.Length = 0;
System.Windows.Input.Manipulations (3)
System\Windows\Input\Manipulations\InertiaProcessor2D.cs (1)
603log.Length = 0;
System\Windows\Input\Manipulations\ManipulationSequence.cs (2)
357this.log.Length = 0; 639this.log.Length = 0;
1040 references to Length
aspire (39)
Bundles\BundleService.cs (1)
785var prefix = sb.Length == 0 ? "bundle" : sb.ToString();
Documentation\ApiDocs\ApiMemberMarkdownParser.cs (2)
186if (pendingSeparator && builder.Length > 0) 196pendingSeparator = builder.Length > 0;
src\Shared\ConsoleLogs\UrlParser.cs (1)
42if (builder?.Length > 0)
Utils\Markdown\MarkdownToSpectreConverter.cs (10)
86while (builder.Length > contentStart && char.IsWhiteSpace(builder[builder.Length - 1])) 92while (builder.Length > contentStart && char.IsWhiteSpace(builder[contentStart])) 100if (contentStart >= builder.Length) 108for (var index = builder.Length - 1; index >= contentStart; index--) 129for (var index = contentStart; index < builder.Length; index++) 137if (nextIndex < builder.Length && builder[nextIndex] != '\n') 147if (indentation <= 0 || contentStart >= builder.Length) 158for (var index = contentStart; index < builder.Length; index++) 166if (nextIndex < builder.Length && builder[nextIndex] != '\n')
Utils\Markdown\MarkdownToSpectreConverter.Markup.cs (24)
49var blockStart = builder.Length; 85var start = builder.Length; 106return builder.Length > start; 121var childStart = contentBuilder.Length; 149if (contentBuilder.Length == 0) 242var start = builder.Length; 248while (builder.Length > start && builder[builder.Length - 1] == '\n') 285return builder.Length > start; 294var blockStart = builder.Length; 328var quoteStart = builder.Length; 340var start = builder.Length; 346var itemStart = builder.Length; 362return builder.Length > start; 367var start = builder.Length; 373var blockStart = builder.Length; 380var contentStart = builder.Length; 393var contentStart = builder.Length; 408var nestedContentStart = builder.Length; 423return builder.Length > start; 553var contentStart = builder.Length; 557var appendedLength = builder.Length - contentStart; 578var linkContentStart = builder.Length; 581if (builder.Length == linkContentStart)
Utils\Markdown\MarkdownToSpectreConverter.Renderable.cs (1)
82return builder.Length == 0
Aspire.Cli.Tests (1)
Utils\CliTestHelper.cs (1)
909if (_buffer.Length > 0)
Aspire.Dashboard (5)
Components\Controls\LogViewer.razor.cs (1)
215if (builder.Length > 0)
Components\Layout\MainLayout.razor.cs (1)
146if (unsecuredEndpointsMessage.Length > 0)
Components\Resize\GridColumnManager.razor.cs (1)
100if (sb.Length > 0)
Model\GenAI\GenAIVisualizerDialogViewModel.cs (1)
141if (sb.Length > 0)
src\Shared\ConsoleLogs\UrlParser.cs (1)
42if (builder?.Length > 0)
Aspire.Hosting (6)
ApplicationModel\ReferenceExpression.cs (2)
306else if (!lastWasSeparator && builder.Length > 0) 496public bool IsEmpty => _builder.Length == 0;
Dcp\DcpLogParser.cs (2)
209if (sb.Length > SystemLogPrefix.Length || hasAddedField) 230if (sb.Length > SystemLogPrefix.Length)
Dcp\ResourceLogSource.cs (2)
162if (sb.Length > 0) 175if (sb.Length > 0 && sb[^1] == '\r')
Aspire.Hosting.Azure.Kubernetes (2)
AzureKubernetesEnvironmentResource.AksPipeline.cs (2)
419if (string.IsNullOrEmpty(line) || errorCapture.Length >= kubectlErrorCaptureBytes) 424var remaining = kubectlErrorCaptureBytes - errorCapture.Length;
Aspire.Hosting.CodeGeneration.Go (2)
AtsGoCodeGenerator.cs (2)
1071if (sb.Length > 0) 1081if (sb.Length > 0)
Aspire.Hosting.CodeGeneration.Java (5)
AtsJavaCodeGenerator.cs (5)
1415if (overloadParameters.Length > 0) 1471if (overloadParameters.Length > 0) 1605if (overloadParameters.Length > 0) 1616if (overloadParameters.Length > 0) 1785if (paramList.Length > 0)
Aspire.Hosting.CodeGeneration.Python (9)
AtsPythonCodeGenerator.cs (5)
2289if (sb.Length == 0 && char.IsDigit(c)) 2297else if (!previousWasSeparator && sb.Length > 0) 2331if (sb.Length == 0 && char.IsDigit(c)) 2340var sanitized = sb.Length > 0 ? sb.ToString() : "_"; 2682if (current.Length > 0)
PythonModuleBuilder.cs (4)
92if (Enums.Length > 0) 117if (DtoClasses.Length > 0) 127if (ExportedValues.Length > 0) 182if (EntryPoints.Length > 0)
Aspire.Hosting.DevTunnels (1)
DevTunnelCli.cs (1)
317if (sb.Length > 0)
Aspire.Hosting.Java (5)
JavaHostingExtensions.cs (1)
2194if (name is not null && value.Length > 0)
JavaVersionDetector.cs (4)
368var interiorStart = builder.Length; 383spans.Add(new Range(interiorStart, builder.Length)); 396if (index >= contents.Length && (spans.Count == 0 || spans[^1].End.Value != builder.Length)) 398spans.Add(new Range(interiorStart, builder.Length));
Aspire.Hosting.Radius (2)
Publishing\RadiusInfrastructureBuilder.cs (2)
1282if (literal.Length > 0) 1303if (literal.Length > 0)
Aspire.Hosting.Redis (1)
RedisBuilderExtensions.cs (1)
274var hostString = $"{(hostsVariableBuilder.Length > 0 ? "," : string.Empty)}{redisInstance.Name}:{redisInstance.Name}:{endpoint.TargetPort}:0";
Aspire.Hosting.SqlServer (1)
SqlServerBuilderExtensions.cs (1)
314if (batchBuilder.Length > 0)
Aspire.Hosting.Tests (2)
Backchannel\BackchannelContractTests.cs (2)
179Assert.True(errors.Length == 0, $"Contract violations found:\n{errors}"); 243Assert.True(errors.Length == 0, $"Trace context copy violations found:\n{errors}");
Aspire.TerminalHost (1)
TerminalHostArgs.cs (1)
119if (message.Length > 0)
dotnet-svcutil-lib (60)
CmdCredentialsProvider.cs (2)
288else if (keyInfo.Key == ConsoleKey.Backspace && userInput.Length > 0) 291userInput = userInput.Remove(userInput.Length - 1, 1);
FrameworkFork\Microsoft.Xml\Xml\BufferBuilder.cs (6)
331int charsLeft = _length - _stringBuilder.Length; 383if (startIndex < _stringBuilder.Length) 385if (len < _stringBuilder.Length) 391sb.Append(_stringBuilder.ToString(startIndex, _stringBuilder.Length - startIndex)); 392len -= (_stringBuilder.Length - startIndex); 398startIndex -= _stringBuilder.Length;
FrameworkFork\Microsoft.Xml\Xml\Core\XmlEventCache.cs (4)
71if (_singleText.Length == 0) 108if (_singleText.Length != 0) 268if (_singleText.Length != 0) 548if (_singleText.Length != 0)
FrameworkFork\Microsoft.Xml\Xml\Dom\XmlNode.cs (2)
762sb.Remove(0, sb.Length); 768if (firstChildTextLikeNode != null && sb.Length > 0)
FrameworkFork\Microsoft.Xml\Xml\schema\XmlSchemaValidator.cs (2)
929if (_textValue.Length > 0) 2647Debug.Assert(builder.Length != 0);
FrameworkFork\Microsoft.Xml\Xml\schema\XmlValueConverter.cs (1)
3642if (bldr.Length != 0)
FrameworkFork\Microsoft.Xml\Xml\schema\XsdDuration.cs (4)
459len = sb.Length; 461zeroIdx = sb.Length - 1; 481if (sb[sb.Length - 1] == 'P') 487if (sb[sb.Length - 1] == 'P')
FrameworkFork\Microsoft.Xml\Xml\Serialization\CodeIdentifier.cs (4)
70for (int i = 0; i < identifier.Length && builder.Length < MaxIdentifierLength; i++) 75if (builder.Length == 0 && !IsValidStart(c)) 82if (builder.Length == 0) return "Item"; 288if (sb.Length != originalIdentifier.Length)
FrameworkFork\Microsoft.Xml\Xml\Serialization\Mappings.cs (1)
1186if (anyNamespaces.Length > 0)
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlCustomFormatter.cs (2)
158if (sb.Length != 0) 169if (sb.Length == 0 && iZero >= 0)
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlSerializationWriter.cs (1)
1287if (arrayDims.Length > 0)
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\CodeExporter.cs (11)
1333for (int i = 0; i < identifier.Length && builder.Length < MaxIdentifierLength; i++) 1344if (builder.Length == 0) 1447if (builder.Length == 0) 1450int length = builder.Length; 1451if (builder[builder.Length - 1] == '.') 1463int fragmentOffset = builder.Length; 1466for (int i = 0; i < fragment.Length && builder.Length < MaxIdentifierLength; i++) 1478else if ((c == '.' || c == '/' || c == ':') && (builder.Length == 1 1479|| (builder.Length > 1 && builder[builder.Length - 1] != '.'))) 1483fragmentOffset = builder.Length;
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\XmlObjectSerializerReadContext.cs (1)
259if (stringBuilder.Length != 0)
FrameworkFork\System.ServiceModel\Internals\System\Runtime\UrlUtility.cs (1)
596if (s.Length > 0)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\AddressHeader.cs (1)
77builder.Remove(0, builder.Length);
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\AddressHeaderCollection.cs (1)
150builder.Remove(0, builder.Length);
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\BindingContext.cs (1)
126if (builder.Length > 0)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\ChannelRequirements.cs (2)
271if (contractChannelTypes.Length > 0) 315if (bindingChannelTypes.Length > 0)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\SocketConnection.cs (1)
523if (addressStringBuilder.Length > 0)
FrameworkFork\System.ServiceModel\System\ServiceModel\Description\UniqueCodeIdentifierScope.cs (3)
97for (int i = 0; i < identifier.Length && builder.Length < MaxIdentifierLength; i++) 102if (builder.Length == 0) 111if (builder.Length == 0)
FrameworkFork\System.ServiceModel\System\ServiceModel\Dispatcher\ChannelDispatcher.cs (1)
514if (endpointContractNames.Length > 0)
FrameworkFork\System.ServiceModel\System\ServiceModel\Dispatcher\EndpointAddressProcessor.cs (2)
119valueLength = builder.Length; 145int len = builder.Length - startLength;
FrameworkFork\System.ServiceModel\System\ServiceModel\Security\SecurityUtils.cs (4)
563if (str.Length > 0) 571if (str.Length <= 0) 586if (str.Length > 0) 594return str.Length <= 0 ? String.Empty : str.ToString();
FrameworkFork\System.Web.Services\Services\Description\ServiceDescriptionSerializer.cs (1)
3869if (sb.Length != 0)
Shared\FrameworkInfo.cs (1)
60for (int j = 1; j < sb.Length; j += 2)
GenerateDocumentationAndConfigFiles (4)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\StringTable.cs (1)
500if (array.Length != text.Length)
src\roslyn\src\Dependencies\PooledObjects\PooledStringBuilder.cs (2)
40get { return this.Builder.Length; } 108Debug.Assert(builder.Builder.Length == 0);
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (1)
185if (currentXmlComment.Length > 0)
ILCompiler.TypeSystem (3)
src\runtime\src\coreclr\tools\Common\TypeSystem\Common\Utilities\DebugNameFormatter.cs (1)
102int initialLen = sb.Length;
src\runtime\src\coreclr\tools\Common\TypeSystem\IL\ILDisassembler.cs (2)
239if (sb.Length < 22) 240sb.Append(' ', 22 - sb.Length);
illink (1)
Infrastructure.Common (1)
JsonSerializer.cs (1)
25sb.Remove(sb.Length - 2, 2);
Infrastructure.Tests (1)
CreateFailingTestIssue\CreateFailingTestIssueToolTests.cs (1)
997while (builder.Length < targetLength)
Microsoft.Analyzers.Extra (1)
LegacyLoggingFixer.FixDetails.cs (1)
235if (char.IsLetter(ch) || (char.IsLetterOrDigit(ch) && sb.Length > 1))
Microsoft.AspNetCore.Components.Endpoints (2)
Rendering\Buffering\TextChunk.cs (1)
43_charArraySegmentStart = charArraySegmentScope.Length;
Rendering\CacheViewTextWriter.cs (1)
175if (_buffer.Length > 0)
Microsoft.AspNetCore.Components.Testing (3)
Infrastructure\ServerInstance.cs (3)
355if (_stdoutBuffer.Length > 0) 363if (_stderrBuffer.Length > 0) 369return sb.Length > 0 ? sb.ToString() : "(no output captured)";
Microsoft.AspNetCore.Components.WebAssembly (1)
Services\WebAssemblyConsoleLogger.cs (1)
122var len = logBuilder.Length;
Microsoft.AspNetCore.Diagnostics (1)
src\aspnetcore\src\Shared\TypeNameHelper\TypeNameHelper.cs (1)
88builder.Replace(DefaultNestedTypeDelimiter, options.NestedTypeDelimiter, builder.Length - name.Length, name.Length);
Microsoft.AspNetCore.Hosting (1)
src\aspnetcore\src\Shared\TypeNameHelper\TypeNameHelper.cs (1)
88builder.Replace(DefaultNestedTypeDelimiter, options.NestedTypeDelimiter, builder.Length - name.Length, name.Length);
Microsoft.AspNetCore.Http.Extensions (1)
src\aspnetcore\src\Shared\TypeNameHelper\TypeNameHelper.cs (1)
88builder.Replace(DefaultNestedTypeDelimiter, options.NestedTypeDelimiter, builder.Length - name.Length, name.Length);
Microsoft.AspNetCore.InternalTesting (2)
TestFileOutputContext.cs (2)
131if (sb.Length > 0 && sb[sb.Length - 1] != '_')
Microsoft.AspNetCore.JsonPatch (2)
Internal\ParsedPath.cs (2)
51if (sb.Length > 0) 84if (sb.Length > 0)
Microsoft.AspNetCore.JsonPatch.SystemTextJson (2)
Internal\ParsedPath.cs (2)
46if (sb.Length > 0) 79if (sb.Length > 0)
Microsoft.AspNetCore.Mvc.Abstractions (1)
src\aspnetcore\src\Shared\TypeNameHelper\TypeNameHelper.cs (1)
88builder.Replace(DefaultNestedTypeDelimiter, options.NestedTypeDelimiter, builder.Length - name.Length, name.Length);
Microsoft.AspNetCore.Mvc.Core (4)
ModelBinding\JQueryKeyValuePairNormalizer.cs (1)
88if (builder.Length != 0)
Routing\RoutePatternWriter.cs (1)
15if (sb.Length > 0)
Routing\UrlHelperBase.cs (2)
138if (builder.Length == 0 || builder[0] != '/') 200if (builder.Length == 0 || builder[0] != '/')
Microsoft.AspNetCore.OpenApi (1)
src\aspnetcore\src\Shared\TypeNameHelper\TypeNameHelper.cs (1)
88builder.Replace(DefaultNestedTypeDelimiter, options.NestedTypeDelimiter, builder.Length - name.Length, name.Length);
Microsoft.AspNetCore.OutputCaching (1)
StringBuilderExtensions.cs (1)
14builder.EnsureCapacity(builder.Length + value.Length);
Microsoft.AspNetCore.Razor.Utilities.Shared (4)
src\roslyn\src\Dependencies\PooledObjects\PooledStringBuilder.cs (2)
40get { return this.Builder.Length; } 108Debug.Assert(builder.Builder.Length == 0);
src\roslyn\src\Razor\src\Shared\Microsoft.AspNetCore.Razor.SharedUtilities\StringBuilderExtensions.cs (2)
25while (start < builder.Length && char.IsWhiteSpace(builder[start])) 30var end = builder.Length - 1;
Microsoft.AspNetCore.ResponseCaching (1)
StringBuilderExtensions.cs (1)
14builder.EnsureCapacity(builder.Length + value.Length);
Microsoft.AspNetCore.Routing (9)
DefaultLinkGenerator.cs (1)
464builder.Remove(builder.Length - 2, 2);
UriBuildingContext.cs (8)
109if (_path.Length != 0) 118_lastValueOffset = _path.Length; 122if (_path.Length == 0 && value.Length > 0 && value[0] == '/') 178if (_path.Length != 0 || _buffer.Count != 0) 231if (_path.Length > 0 && _path[0] != '/') 245if (_path.Length > 0) 253if (AppendTrailingSlash && _path[_path.Length - 1] != '/') 271if (_query.Length > 0 && _query[0] != '?')
Microsoft.AspNetCore.Server.IIS (1)
src\aspnetcore\src\Shared\TypeNameHelper\TypeNameHelper.cs (1)
88builder.Replace(DefaultNestedTypeDelimiter, options.NestedTypeDelimiter, builder.Length - name.Length, name.Length);
Microsoft.AspNetCore.SpaServices.Extensions (1)
Util\EventedStreamReader.cs (1)
82if (_linesBuffer.Length > 0)
Microsoft.AspNetCore.WebUtilities (1)
FormReader.cs (1)
245if (_builder.Length >= limit)
Microsoft.Build (8)
BackEnd\Node\OutOfProcServerNode.cs (1)
825if (_internalWriter.GetStringBuilder().Length > 0)
BackEnd\TaskExecutionHost\TaskExecutionHost.cs (2)
1895if (joinedOutputs.Length > 0) 1982if (joinedOutputs.Length > 0)
Construction\Solution\SolutionProjectGenerator.cs (1)
612for (int i = 1; i < builder.Length; i++)
src\msbuild\artifacts\.packages\microsoft.codeanalysis.pooledobjects\5.0.0-1.25277.114\contentFiles\cs\netstandard2.0\PooledStringBuilder.cs (2)
36get { return this.Builder.Length; } 95Debug.Assert(builder.Builder.Length == 0);
Utilities\NuGetFrameworkWrapper.cs (1)
75if (tfmList.Length > 0)
Utilities\Utilities.cs (1)
336if (sb.Length != 0)
Microsoft.Build.Framework (3)
ReuseableStringBuilder.cs (2)
55return _borrowedBuilder?.Length ?? 0; 304int returningLength = returningBuilder.Length;
Utilities\StringBuilderCache.cs (1)
132returningLength: builder.Length,
Microsoft.Build.Tasks.CodeAnalysis (5)
src\roslyn\src\Compilers\Core\MSBuildTask\Csc.cs (2)
493if (finalDefineConstants.Length > 0) 506if (finalDefineConstants.Length > 0)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\CommandLineUtilities.cs (3)
145if (quoteCount == 2 && builder[0] == '"' && builder[builder.Length - 1] == '"') 148builder.Remove(builder.Length - 1, length: 1); 151if (builder.Length > 0)
Microsoft.Build.Tasks.Core (10)
BootstrapperUtil\BootstrapperBuilder.cs (3)
778if (productsInLoop.Length > 0 && (buildQueue.Count == 0 || productsToRemove.Count == 0)) 780productsInLoop.Remove(productsInLoop.Length - 2, 2); 782productsInLoop.Remove(0, productsInLoop.Length);
CreateCSharpManifestResourceName.cs (1)
155if (manifestName.Length == 0)
CreateManifestResourceName.cs (2)
357int length = builder.Length; 372if ((builder.Length - length) == 1 && builder[length] == '_')
CreateVisualBasicManifestResourceName.cs (1)
160if (manifestName.Length == 0)
GenerateResource.cs (2)
3702if (name.Length == 0) 3709if (name[name.Length - 1] == ' ')
ManifestUtil\Util.cs (1)
94while (i < sb.Length)
Microsoft.Build.Tasks.Git (6)
GitDataReader\GitConfig.Reader.cs (6)
501while (IsAlphabetic(c = reader.Peek()) || (c == '-' || IsNumeric(c)) && nameBuilder.Length > 0) 569lengthIgnoringTrailingWhitespace = builder.Length; 577lengthIgnoringTrailingWhitespace = builder.Length; 585lengthIgnoringTrailingWhitespace = builder.Length; 591lengthIgnoringTrailingWhitespace = builder.Length; 616lengthIgnoringTrailingWhitespace = builder.Length;
Microsoft.Build.Utilities.Core (4)
CommandLineBuilder.cs (3)
96public int Length => CommandLine.Length; 216if (CommandLine.Length != 0) 222else if (CommandLine[CommandLine.Length - 1] != ' ')
ToolTask.cs (1)
1740int length = sb.Length;
Microsoft.CodeAnalysis (19)
CaseInsensitiveComparison.cs (1)
396for (int i = 0; i < builder.Length; i++)
DiagnosticAnalyzer\AnalysisContextInfo.cs (2)
137if (sb.Length > cutoff) 143return sb.ToString() + (sb.Length > cutoff ? " ..." : string.Empty);
InternalUtilities\CommandLineUtilities.cs (3)
145if (quoteCount == 2 && builder[0] == '"' && builder[builder.Length - 1] == '"') 148builder.Remove(builder.Length - 1, length: 1); 151if (builder.Length > 0)
InternalUtilities\StringTable.cs (1)
500if (array.Length != text.Length)
src\roslyn\src\Dependencies\CodeAnalysis.Debugging\CustomDebugInfoReader.cs (1)
258Debug.Assert(nameBuilder.Length == 0);
src\roslyn\src\Dependencies\PooledObjects\PooledStringBuilder.cs (2)
40get { return this.Builder.Length; } 108Debug.Assert(builder.Builder.Length == 0);
Symbols\Attributes\AttributeUsageInfo.cs (1)
193if (builder.Builder.Length > 0)
Syntax\SyntaxDiffer.cs (5)
769newText.Remove(newText.Length - commonTrailingCount, commonTrailingCount); 796int maxChars = Math.Min(oldText.Length, newText.Length); 813if (oldText[oldText.Length - commonTrailingCount - 1] != newText[newText.Length - commonTrailingCount - 1])
Text\StringBuilderText.cs (3)
51get { return _builder.Length; } 65if (position < 0 || position >= _builder.Length) 80if (span.End > _builder.Length)
Microsoft.CodeAnalysis.Analyzers (6)
MetaAnalyzers\DiagnosticDescriptorCreationAnalyzer_IdRangeAndCategoryValidation.cs (1)
115if (arg3.Length != 0)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\Hash.cs (1)
336int end = text.Length;
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\StringTable.cs (1)
500if (array.Length != text.Length)
src\roslyn\src\Dependencies\PooledObjects\PooledStringBuilder.cs (2)
40get { return this.Builder.Length; } 108Debug.Assert(builder.Builder.Length == 0);
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (1)
185if (currentXmlComment.Length > 0)
Microsoft.CodeAnalysis.AnalyzerUtilities (5)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\Hash.cs (1)
336int end = text.Length;
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\StringTable.cs (1)
500if (array.Length != text.Length)
src\roslyn\src\Dependencies\PooledObjects\PooledStringBuilder.cs (2)
40get { return this.Builder.Length; } 108Debug.Assert(builder.Builder.Length == 0);
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (1)
185if (currentXmlComment.Length > 0)
Microsoft.CodeAnalysis.CodeStyle (7)
src\roslyn\src\Analyzers\Core\Analyzers\FileHeaders\AbstractFileHeaderHelper.cs (3)
75if (sb.Length == 0) 119if (sb.Length > 0) 123sb.Remove(sb.Length - eolLength, eolLength);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\Hash.cs (1)
336int end = text.Length;
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\StringTable.cs (1)
500if (array.Length != text.Length)
src\roslyn\src\Dependencies\PooledObjects\PooledStringBuilder.cs (2)
40get { return this.Builder.Length; } 108Debug.Assert(builder.Builder.Length == 0);
Microsoft.CodeAnalysis.CSharp (15)
BoundTree\BoundNode_Source.cs (2)
507builder.Remove(builder.Length - indentSize, indentSize); 520builder.Remove(builder.Length - indentSize, indentSize);
Parser\Directives.cs (1)
378if (sb.Length > 0)
Parser\Lexer_StringLiteral.cs (4)
78if (_builder.Length != 1) 80this.AddError((_builder.Length != 0) ? ErrorCode.ERR_TooManyCharsInConst : ErrorCode.ERR_EmptyCharConst); 83if (_builder.Length > 0) 107if (_builder.Length > 0)
Parser\Lexer.cs (1)
930else if (_builder.Length == 0)
Symbols\Source\AttributeLocation.cs (1)
48if (result.Length > 0)
Symbols\Source\SourceNamedTypeSymbol_Extension.cs (2)
103if (builder[builder.Length - 1] == ' ') 105builder.Remove(startIndex: builder.Length - 1, length: 1);
Symbols\Symbol.cs (1)
993return builder.Length == 0 ? null : builder.ToString();
Utilities\ValueSetFactory.FloatingValueSet.cs (1)
170if (b.Length > 1 && more.Length > 1)
Utilities\ValueSetFactory.NintValueSet.cs (1)
139if (_hasLarge && builder.Length > 0)
Utilities\ValueSetFactory.NuintValueSet.cs (1)
118if (_hasLarge && builder.Length > 0)
Microsoft.CodeAnalysis.CSharp.CodeStyle (2)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTriviaExtensions.cs (1)
109textBuilder.Remove(textBuilder.Length - newLine.Length, newLine.Length);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\CSharpFormattingOptions2.Parsers.cs (1)
55if (builder.Length > 0)
Microsoft.CodeAnalysis.CSharp.Features (1)
ConvertToRawString\ConvertInterpolatedStringToRawStringCodeRefactoringProvider.cs (1)
617var lastIndex = builder.Length;
Microsoft.CodeAnalysis.CSharp.Workspaces (2)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTriviaExtensions.cs (1)
109textBuilder.Remove(textBuilder.Length - newLine.Length, newLine.Length);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\CSharpFormattingOptions2.Parsers.cs (1)
55if (builder.Length > 0)
Microsoft.CodeAnalysis.Extensions.Package (3)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\Hash.cs (1)
336int end = text.Length;
src\roslyn\src\Dependencies\PooledObjects\PooledStringBuilder.cs (2)
40get { return this.Builder.Length; } 108Debug.Assert(builder.Builder.Length == 0);
Microsoft.CodeAnalysis.Features (10)
Completion\CommonCompletionItem.cs (1)
99if (builder.Length > 0)
DocumentationComments\AbstractDocumentationCommentFormattingService.cs (2)
608if (builder.Length == 0) 625if (builder.Length > 0)
ExternalAccess\UnitTesting\API\UnitTestingSearchHelpers.cs (1)
116if (result.Length > 0)
MetadataAsSource\AbstractMetadataAsSourceService.DocCommentFormatter.cs (1)
202if (sb.Length >= s_wrapLength)
NavigateTo\RegexQueryCompiler.cs (1)
151if (builder.Length < 2)
src\roslyn\src\Analyzers\Core\Analyzers\FileHeaders\AbstractFileHeaderHelper.cs (3)
75if (sb.Length == 0) 119if (sb.Length > 0) 123sb.Remove(sb.Length - eolLength, eolLength);
src\roslyn\src\Dependencies\CodeAnalysis.Debugging\CustomDebugInfoReader.cs (1)
258Debug.Assert(nameBuilder.Length == 0);
Microsoft.CodeAnalysis.NetAnalyzers (2)
Microsoft.NetCore.Analyzers\Runtime\DoNotPassLiteralsAsLocalizedParameters.cs (1)
339if (literals.Length > 0)
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\Compiler\RulesetToEditorconfigConverter.cs (1)
184if (currentXmlComment.Length > 0)
Microsoft.CodeAnalysis.Razor.Compiler (19)
Language\CSharpIdentifier.cs (2)
54builder.SetCapacityIfLarger(builder.Length + inputName.Length + 1); 59builder.SetCapacityIfLarger(builder.Length + inputName.Length);
Language\Legacy\DirectiveCSharpTokenizer.cs (2)
34Debug.Assert(Buffer.Length == 0); 45Debug.Assert(Buffer.Length == 0);
Language\Legacy\DirectiveHtmlTokenizer.cs (2)
32Debug.Assert(Buffer.Length == 0); 45Debug.Assert(Buffer.Length == 0);
Language\Legacy\HtmlTokenizer.cs (1)
87var tokenLength = Buffer.Length;
Language\Legacy\NativeCSharpTokenizer.cs (1)
184var tokenLength = Buffer.Length;
Language\Legacy\RoslynCSharpTokenizer.cs (1)
149var tokenLength = Buffer.Length;
Language\Legacy\Tokenizer.cs (4)
50get { return Buffer.Length > 0; } 77Debug.Assert(Buffer.Length == 0); 88Debug.Assert(Buffer.Length == 0); 194Debug.Assert(Buffer.Length == 0);
Language\MarkupSplitter.Analysis.cs (2)
41var start = builder.Length; 60spans.Add(new ChildSpan(start, builder.Length - start, child));
Language\NamespaceComputer.cs (2)
141if (builder.Length > 0) 170if (builder.Length > 0)
Language\TagHelpers\Producers\ComponentTagHelperProducer.cs (2)
547if (withAttributes.Length > 0) 590if (withAttributes.Length > 0)
Microsoft.CodeAnalysis.ResxSourceGenerator (5)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\Hash.cs (1)
336int end = text.Length;
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\StringTable.cs (1)
500if (array.Length != text.Length)
src\roslyn\src\Dependencies\PooledObjects\PooledStringBuilder.cs (2)
40get { return this.Builder.Length; } 108Debug.Assert(builder.Builder.Length == 0);
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (1)
185if (currentXmlComment.Length > 0)
Microsoft.CodeAnalysis.Scripting (4)
Hosting\CommandLine\CommandLineRunner.cs (1)
247if (input.Length == 0)
Hosting\ObjectFormatter\CommonObjectFormatter.Builder.cs (3)
37get { return _options.MaximumOutputLength - _sb.Length; } 43get { return _currentLimit - _sb.Length; } 55_currentLimit = (int)Math.Min((long)_sb.Length + _options.MaximumLineLength, _options.MaximumOutputLength);
Microsoft.CodeAnalysis.VisualBasic (7)
Binding\Binder_Query.vb (1)
3615If builder.Length = 0 Then
Scanner\Scanner.vb (2)
101Debug.Assert(_sb.Length = 0, "trying to use dirty buffer?") 367If sb.Length = 1 AndAlso sb(0) = " "c Then
Scanner\ScannerXml.vb (2)
1262If charRefSb.Length > 0 Then 1279If charRefSb.Length > 0 Then
Scanner\XmlCharacterGlobalHelpers.vb (2)
50Dim n = pwcText.Length - 1 99Dim n = pwcText.Length - 1
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (2)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\ExpressionGenerator.StringPiece.vb (2)
102If sb.Length > 0 Then 132If sb.Length > 0 Then
Microsoft.CodeAnalysis.VisualBasic.Workspaces (2)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\ExpressionGenerator.StringPiece.vb (2)
102If sb.Length > 0 Then 132If sb.Length > 0 Then
Microsoft.CodeAnalysis.Workspaces (5)
CodeActions\CodeAction.cs (1)
641return equivalenceKey.Length > 0 ? equivalenceKey.ToString() : null;
Log\KeyValueLogMessage.cs (1)
182if (builder.Length > 0)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\StringTable.cs (1)
500if (array.Length != text.Length)
src\roslyn\src\Dependencies\PooledObjects\PooledStringBuilder.cs (2)
40get { return this.Builder.Length; } 108Debug.Assert(builder.Builder.Length == 0);
Microsoft.CSharp (1)
Microsoft\CSharp\RuntimeBinder\Errors\UserStringBuilder.cs (1)
19Debug.Assert(_strBuilder == null || _strBuilder.Length == 0);
Microsoft.Data.Analysis (2)
PrimitiveColumnContainer.cs (1)
440if (sb.Length > 1000)
TextFieldParser.cs (1)
1015_delimiterRegex = new Regex(builder.ToString(0, builder.Length - 1), (RegexOptions)512);
Microsoft.Data.Analysis.Tests (1)
src\Microsoft.Data.Analysis\TextFieldParser.cs (1)
1015_delimiterRegex = new Regex(builder.ToString(0, builder.Length - 1), (RegexOptions)512);
Microsoft.Diagnostics.DataContractReader.Legacy (5)
ClrDataMethodDefinition.cs (1)
343if (name is not null && bufLen < (uint)(sb.Length + 1))
ClrDataMethodInstance.cs (1)
193if (!fallbackToUnknown && nameBuf != null && bufLen < sb.Length + 1)
TypeNameBuilder.cs (3)
441if (TypeString.Length > 0) 442TypeString.Remove(TypeString.Length - 1, 1); 452GenericStartsStack.Push(TypeString.Length);
Microsoft.DotNet.Build.Manifest (2)
VersionIdentifier.cs (2)
167if (versionSuffix.Length == 0 && 174else if (versionSuffix.Length != 0 && !int.TryParse(nextSegment, out int potentialVersionSegment) && nextSegment != _finalSuffix)
Microsoft.DotNet.Build.Tasks.Templating (1)
GenerateFileFromTemplate.cs (1)
200if (varNameSb.Length > 0)
Microsoft.DotNet.Cli.Definitions (1)
Help\HelpBuilder.cs (1)
367if (sb.Length > 0)
Microsoft.DotNet.Cli.Utils (1)
StreamForwarder.cs (1)
83if (_builder.Length > 0)
Microsoft.DotNet.HotReload.Watch (1)
Utilities\CommandLineUtilities.cs (1)
26if (stringBuilder.Length != 0)
Microsoft.DotNet.PackageTesting (1)
VerifyClosure.cs (1)
332if (builder.Length > 0)
Microsoft.DotNet.SharedFramework.Sdk (1)
src\arcade\src\Microsoft.DotNet.PackageTesting\VerifyClosure.cs (1)
332if (builder.Length > 0)
Microsoft.DotNet.SourceBuild.Tasks (2)
src\UsageReport\WriteUsageReports.cs (2)
124if (sourceBuildCreator.Length != 0) 146SourceBuildPackageIdCreator = sourceBuildCreator.Length == 0
Microsoft.Extensions.AI.Abstractions (1)
Contents\AIContentExtensions.cs (1)
103if (builder.Length > 0)
Microsoft.Extensions.AI.Evaluation.NLP (10)
Common\SimpleWordTokenizer.cs (10)
51if (sb.Length > 0) 66if (sb.Length > 0) 94if (sb.Length > 0) 106if (sb.Length > 0) 118if (sb.Length > 0) 130if (sb.Length > 0) 142if (sb.Length > 0) 157if (sb.Length > 0) 171if (sb.Length > 0) 187if (sb.Length > 0)
Microsoft.Extensions.AI.OpenAI (1)
OpenAIClientExtensions.cs (1)
103if (sb.Length > 0)
Microsoft.Extensions.Compliance.Abstractions (1)
Classification\DataClassificationSet.cs (1)
124if (sb.Length > 1)
Microsoft.Extensions.Compliance.Abstractions.Tests (1)
Redaction\RedactionAbstractionsExtensionsTest.cs (1)
29Assert.Equal(0, sb.Length);
Microsoft.Extensions.Configuration.Binder.SourceGeneration (3)
Parser\Extensions.cs (2)
113if (sb.Length > 500) 116sb.Remove(490, sb.Length - 490).Append(hash);
src\runtime\src\libraries\Common\src\SourceGenerators\SourceWriter.cs (1)
66Debug.Assert(_indentation == 0 && _sb.Length > 0);
Microsoft.Extensions.Configuration.Xml (2)
XmlStreamConfigurationProvider.cs (2)
420if (_sb.Length != 0) 437_sb.Remove(_sb.Length - length, length);
Microsoft.Extensions.DataIngestion (3)
Chunkers\DocumentTokenChunker.cs (1)
86if (stringBuilder.Length > 0)
Chunkers\ElementsChunker.cs (2)
213length: _currentChunk.Length - context.Length); 224if (stringBuilder.Length > 0)
Microsoft.Extensions.DependencyInjection (1)
src\runtime\src\libraries\Common\src\Extensions\TypeNameHelper\TypeNameHelper.cs (1)
102builder.Replace(DefaultNestedTypeDelimiter, options.NestedTypeDelimiter, builder.Length - name.Length, name.Length);
Microsoft.Extensions.Diagnostics.Abstractions (1)
src\runtime\src\libraries\Common\src\Extensions\TypeNameHelper\TypeNameHelper.cs (1)
102builder.Replace(DefaultNestedTypeDelimiter, options.NestedTypeDelimiter, builder.Length - name.Length, name.Length);
Microsoft.Extensions.Diagnostics.HealthChecks (1)
DefaultHealthCheckService.cs (1)
179throw new ArgumentException(builder.ToString(0, builder.Length - 2), nameof(registrations));
Microsoft.Extensions.FileProviders.Embedded (2)
EmbeddedFileProvider.cs (2)
264var length = builder.Length; 279if ((builder.Length - length) == 1 && builder[length] == '_')
Microsoft.Extensions.Http (1)
src\runtime\src\libraries\Common\src\Extensions\TypeNameHelper\TypeNameHelper.cs (1)
102builder.Replace(DefaultNestedTypeDelimiter, options.NestedTypeDelimiter, builder.Length - name.Length, name.Length);
Microsoft.Extensions.Logging.Abstractions (1)
src\runtime\src\libraries\Common\src\Extensions\TypeNameHelper\TypeNameHelper.cs (1)
102builder.Replace(DefaultNestedTypeDelimiter, options.NestedTypeDelimiter, builder.Length - name.Length, name.Length);
Microsoft.Extensions.Logging.Console (2)
ConsoleLogger.cs (2)
60if (sb.Length == 0) 86if (sb.Length == 0)
Microsoft.Extensions.ServiceDiscovery (1)
Configuration\ConfigurationServiceEndpointProvider.Log.cs (1)
35if (endpointValues.Length > 0)
Microsoft.Extensions.ServiceDiscovery.Dns (1)
Resolver\EncodedDomainName.cs (1)
25if (sb.Length > 0)
Microsoft.Extensions.Telemetry (4)
Http\HttpRouteFormatter.cs (2)
160if (formattedHttpPath.Length > 1) 162int index = formattedHttpPath.Length - 1;
Logging\ExtendedLogger.cs (2)
164return sb.Length > config.MaxStackTraceLength 177if (sb.Length > 0)
Microsoft.Extensions.Telemetry.Abstractions (2)
Logging\LoggerMessageState.cs (2)
134if (sb.Length > 0) 146if (sb.Length > 0)
Microsoft.Extensions.Telemetry.Tests (4)
Logging\ExtendedLoggerFactoryTests.cs (4)
143sb.Append(sb.Length > 0 ? $", TraceId:{activity.GetTraceId()}" : $"TraceId:{activity.GetTraceId()}"); 148sb.Append(sb.Length > 0 ? $", ParentId:{activity.GetParentId()}" : $"ParentId:{activity.GetParentId()}"); 153sb.Append(sb.Length > 0 ? $", TraceState:{activity.TraceStateString}" : $"TraceState:{activity.TraceStateString}"); 158sb.Append(sb.Length > 0 ? $", TraceFlags:{activity.ActivityTraceFlags}" : $"TraceFlags:{activity.ActivityTraceFlags}");
Microsoft.Gen.MetadataExtractor (1)
Parser_2.cs (1)
877if (stringBuilder.Length != 0)
Microsoft.Gen.Metrics (1)
Parser.cs (1)
877if (stringBuilder.Length != 0)
Microsoft.Gen.MetricsReports (1)
Parser.cs (1)
877if (stringBuilder.Length != 0)
Microsoft.Maui.Controls (2)
Shapes\PathFigureCollectionConverter.cs (2)
664 if (sb.Length > 0) 668 if (sb[sb.Length - 1] == ' ')
Microsoft.Maui.Controls.Xaml (2)
MarkupExpressionParser.cs (2)
228 while (piece.Length > 0 && char.IsWhiteSpace(piece[piece.Length - 1]))
Microsoft.ML.AutoML.SourceGenerator (5)
Template\EstimatorType.cs (1)
161if (((this.GenerationEnvironment.Length == 0)
Template\SearchSpace.cs (1)
178if (((this.GenerationEnvironment.Length == 0)
Template\SweepableEstimator_T_.cs (1)
185if (((this.GenerationEnvironment.Length == 0)
Template\SweepableEstimator.cs (1)
180if (((this.GenerationEnvironment.Length == 0)
Template\SweepableEstimatorFactory.cs (1)
156if (((this.GenerationEnvironment.Length == 0)
Microsoft.ML.CodeGenerator (17)
CodeGenerator\CSharp\TrainerGeneratorBase.cs (1)
151sb.Remove(sb.Length - 1, 1); //remove the last ,
CodeGenerator\CSharp\TransformGenerators.cs (6)
62sb.Remove(sb.Length - 1, 1); // remove extra , 93sb.Remove(sb.Length - 1, 1); 198sb.Remove(sb.Length - 1, 1); // remove extra , 232sb.Remove(sb.Length - 1, 1); // remove extra , 267sb.Remove(sb.Length - 1, 1); // remove extra , 325sb.Remove(sb.Length - 1, 1); // remove extra ,
Templates\Azure\Console\AzureModelBuilder.cs (1)
255if (((this.GenerationEnvironment.Length == 0)
Templates\Azure\Model\AzureImageModelOutputClass.cs (1)
196if (((this.GenerationEnvironment.Length == 0)
Templates\Azure\Model\AzureObjectDetectionModelOutputClass.cs (1)
196if (((this.GenerationEnvironment.Length == 0)
Templates\Console\ConsumeModel.cs (1)
207if (((this.GenerationEnvironment.Length == 0)
Templates\Console\ModelBuilder.cs (1)
572if (((this.GenerationEnvironment.Length == 0)
Templates\Console\ModelInputClass.cs (1)
170if (((this.GenerationEnvironment.Length == 0)
Templates\Console\ModelOutputClass.cs (1)
213if (((this.GenerationEnvironment.Length == 0)
Templates\Console\ModelProject.cs (1)
202if (((this.GenerationEnvironment.Length == 0)
Templates\Console\PredictProgram.cs (1)
229if (((this.GenerationEnvironment.Length == 0)
Templates\Console\PredictProject.cs (1)
207if (((this.GenerationEnvironment.Length == 0)
Microsoft.ML.Core (27)
CommandLine\CmdLexer.cs (17)
33int ichDst = bldr.Length; 44if (bldr.Length == ichDst) 49if (bldr.Length == ichDst) 59if (bldr.Length == ichDst) 80Contracts.Assert(bldr.Length > ichDst); 330Contracts.Assert(0 <= ich && ich <= sb.Length); 332if (ich >= sb.Length) 340int ichLim = sb.Length; 350if (!lex.Error && curs.Eof && sb.Length == ichLim + cch) 374int ich = sb.Length; 378string v = sb.ToString(ich, sb.Length - ich); 412int ich = sb.Length; 415Contracts.Assert(ich == sb.Length); 420Contracts.Assert(ich == sb.Length); 436int ichDst = sb.Length; 446if (!lex.Error && curs.Eof && sb.Length == ichDst + str.Length) 474if (lex.Error || !curs.Eof || res.Length != str.Length || res.ToString() != str)
CommandLine\CmdParser.cs (7)
323if (sb.Length > 0) 800int ich = sb.Length; 823string str = sb.ToString(ich, sb.Length - ich); 1093if (bldr.Length > 0) 1994if (sb.Length > 0) 2154if (builder.Length > 0) 2162if (builder.Length > 0)
Utilities\Hashing.cs (1)
80return MurmurHash(_defaultSeed, sb, 0, sb.Length);
Utilities\NormStr.cs (1)
174int cch = sb.Length;
Utilities\Utils.cs (1)
57return x == null ? 0 : x.Length;
Microsoft.ML.Data (19)
DataLoadSave\Binary\Codecs.cs (2)
329_boundaries.Add(_builder.Length); 347return sizeof(int) * (1 + (long)_boundaries.Count) + _builder.Length;
DataLoadSave\Text\TextLoader.cs (1)
201int ich = sb.Length;
DataLoadSave\Text\TextLoaderParser.cs (1)
1302if (scan.QuotingError || _sb.Length == 0)
DataLoadSave\Text\TextSaver.cs (3)
635if (sb.Length != def.Length) 660int cch = checked(_cch + sb.Length); 669sb.CopyTo(0, _rgch, _cch, sb.Length);
Evaluators\AnomalyDetectionEvaluator.cs (1)
708if (sb.Length > 0)
Scorers\FeatureContributionCalculation.cs (3)
252if (sb.Length > 0) 254_env.Assert(sb.Length >= 2); 255sb.Remove(sb.Length - 2, 2);
Transforms\ColumnConcatenatingTransformer.cs (1)
658int len = sb.Length;
Transforms\InvertHashUtils.cs (4)
97Utils.EnsureSize(ref buffer, src.Length); 98src.CopyTo(0, buffer, 0, src.Length); 99dst.Append(buffer, 0, src.Length); 211Contracts.Assert(sb.Length == 0);
Transforms\KeyToVector.cs (1)
413int len = sb.Length;
Transforms\SlotsDroppingTransformer.cs (1)
96int ich = sb.Length;
Transforms\TypeConverting.cs (1)
106int ich = sb.Length;
Microsoft.ML.FastTree (1)
FastTree.cs (1)
810if (sb.Length > 0)
Microsoft.ML.InternalCodeAnalyzer (1)
NameFixProvider.cs (1)
140if (sb.Length == prefix.Length)
Microsoft.ML.Maml (2)
HelpCommand.cs (1)
171if (kinds.Length > 0)
MAML.cs (1)
321if (sb.Length > 0)
Microsoft.ML.Parquet (2)
ParquetLoader.cs (2)
773if (sb.Length > 0) 774sb.Remove(sb.Length - 1, 1);
Microsoft.ML.PerformanceTests (2)
Harness\Metrics.cs (2)
64if (buffer.Length > 0) 71return buffer.Length > 0 ? buffer.ToString() : "-";
Microsoft.ML.Samples (1)
Dynamic\DataOperations\LoadingText.cs (1)
36fs.WriteLine(sb.ToString(0, sb.Length - 1));
Microsoft.ML.TestFramework (1)
PasteArguments.cs (1)
15if (stringBuilder.Length != 0)
Microsoft.ML.Transforms (17)
Expression\Lexer.cs (9)
229cchPunc = _sb.Length; 232char ch = ChPeek(_sb.Length); 343Contracts.Assert(_sb.Length > 0); 348for (int ich = 0; ich < _sb.Length; ich++) 365Contracts.Assert(_sb.Length > 0); 530if (_sb.Length != 1) 531ReportError(_sb.Length == 0 ? ErrId.CharConstEmpty : ErrId.CharConstTooLong); 532return new CharLitToken(GetSpan(), _sb.Length > 0 ? _sb[0] : '\0'); 710if (_sb.Length == 0)
HashJoiningTransform.cs (2)
439if (outputSlotName.Length > 0) 627return Hashing.MurmurHash(seed, sb, 0, sb.Length);
KeyToVectorMapping.cs (1)
323int len = sb.Length;
MissingValueIndicatorTransform.cs (1)
224int len = sb.Length;
Text\StopWordsRemovingTransformer.cs (2)
304if (missings.Length > 0) 310if (missings.Length > 0)
Text\TokenizingByCharacters.cs (2)
312boundaries[i] = bldr.Length; 315Host.Assert(bldr.Length == boundaries[boundaries.Length - 1]);
Microsoft.NET.Build.Containers (1)
ContainerHelpers.cs (1)
337if (invalidChars == builder.Length)
Microsoft.Net.Http.Headers (2)
CacheControlHeaderValue.cs (1)
801if (sb.Length > 0)
NameValueHeaderValue.cs (1)
293if (leadingSeparator || (destination.Length > 0))
Microsoft.NET.Sdk.Publish.Tasks (2)
MsDeploy\CommonUtility.cs (2)
337sb.Remove(0, sb.Length); 1151if (sb.Length != 0)
Microsoft.TemplateEngine.Cli (2)
Commands\CommandLineUtils.cs (2)
45if (sb.Length > 0) 105if (sb.Length > 0)
Microsoft.TemplateEngine.Orchestrator.RunnableProjects (3)
ValueForms\DefaultSafeNamespaceValueFormFactory.cs (3)
35bool isFirstCharacterOfIdentifier = safeValueStr.Length == 0 || safeValueStr[safeValueStr.Length - 1] == '.'; 47(safeValueStr.Length > 0 && i < value.Length - 1 && value[i] == '.'))
Microsoft.TestPlatform.AdapterUtilities (7)
Helpers\ReflectionHelpers.cs (1)
36if (stringBuilder.Length == 0)
ManagedNameUtilities\ManagedNameHelper.Reflection.cs (6)
209methodBuilder[methodBuilder.Length - 1] = ')'; 211var methodNameEndIndex = methodBuilder.Length; 369hierarchies[0] = b.Length; 374hierarchies[1] = b.Length; 389hierarchies[2] = b.Length; 559b[b.Length - 1] = '>';
Microsoft.TestPlatform.CommunicationUtilities (2)
Json\Jsonite\Jsonite.cs (2)
791if (builder.Length <= (isNegative ? maxIntStringEasyParse + 1 : maxIntStringEasyParse)) 793for (int i = isNegative ? 1 : 0; i < builder.Length; i++)
Microsoft.TestPlatform.CoreUtilities (3)
Extensions\StringBuilderExtensions.cs (3)
25if (result.Length >= result.MaxCapacity) 34if (result.Length + data.Length >= result.MaxCapacity) 36data = data.Substring(0, result.MaxCapacity - result.Length);
Microsoft.TestPlatform.Filter.Source (6)
Condition.cs (4)
350if (tokenBuilder.Length > 0) 359if (tokenBuilder.Length > 0) 385if (tokenBuilder.Length > 0) 401if (tokenBuilder.Length > 0)
FilterExpression.cs (2)
451if (tokenBuilder.Length > 0) 468if (tokenBuilder.Length > 0)
Microsoft.TestPlatform.Utilities (2)
CommandLineUtilities.cs (1)
120else if (currentArg.Length > 0)
StringExtensions.cs (1)
38if (buffer.Length > 0 || input[input.Length - 1] == separator)
Microsoft.VisualBasic.Core (3)
Microsoft\VisualBasic\CompilerServices\LikeOperator.vb (1)
193Length = NewInput.Length
Microsoft\VisualBasic\CompilerServices\Utils.LateBinder.vb (1)
177StdFormat = sb.ToString(1, sb.Length - 1)
Microsoft\VisualBasic\FileIO\TextFieldParser.vb (1)
1204m_DelimiterRegex = New Regex(Builder.ToString(0, Builder.Length - 1))
Microsoft.VisualBasic.Forms (2)
Microsoft\VisualBasic\Logging\FileLogTraceListener.vb (2)
523If sb.Length >= length Then 524sb.Remove(sb.Length - length, length)
Microsoft.VisualStudio.TestPlatform.Common (8)
src\vstest\src\Microsoft.TestPlatform.Filter.Source\Condition.cs (4)
350if (tokenBuilder.Length > 0) 359if (tokenBuilder.Length > 0) 385if (tokenBuilder.Length > 0) 401if (tokenBuilder.Length > 0)
src\vstest\src\Microsoft.TestPlatform.Filter.Source\FilterExpression.cs (2)
451if (tokenBuilder.Length > 0) 468if (tokenBuilder.Length > 0)
Utilities\SimpleJSON.cs (2)
595if (token.Length > 0 || tokenIsQuoted) 628if (token.Length > 0 || tokenIsQuoted)
Microsoft.VisualStudio.TestPlatform.Extensions.Trx.TestLogger (3)
Utility\TrxFileHelper.cs (2)
234if (newPath.Length > 0) 247if (newPath.Length > 0)
XML\XmlPersistence.cs (1)
861if (query.Length > 0 || queryIn.StartsWith("/", StringComparison.Ordinal))
Microsoft.Web.XmlTransform (5)
XmlAttributePreservingWriter.cs (1)
285int lineLength = linePosition + writeBuffer.Length + 1;
XmlTransforms.cs (4)
403strbuilder.Remove(0, strbuilder.Length); 455if (identifier.Length != 0) 468if (identifier.Length == 0) 540strbuilder.Remove(0, strbuilder.Length);
Microsoft.Win32.Registry (2)
Microsoft\Win32\RegistryKey.cs (2)
1421int temp = sb.Length - 1; 1434int length = path.Length;
NuGet.Commands (3)
RestoreCommand\Diagnostics\DiagnosticUtility.cs (1)
91if (sb.Length == 0)
RestoreCommand\RestoreCommand.cs (2)
1497return builder.ToString(0, builder.Length - 1); 1506if (builder.Length > 0)
NuGet.Common (2)
ExceptionUtilities.cs (1)
201bool indentNext = indent && builder.Length > 0;
Tokenizer\Tokenizer.cs (1)
84if (sb.Length == 0)
NuGet.Packaging (2)
PackageCreation\Authoring\PackageBuilder.cs (1)
973if (warningMessage.Length > Environment.NewLine.Length)
Rules\DependenciesGroupsForEachTFMRule.cs (1)
137if (noExactMatchString.Length == 0)
NuGet.Protocol (2)
UserAgentStringBuilder.cs (2)
109if (sb.Length > 0) sb.Append(", "); 116if (sb.Length > 0) sb.Append(", ");
PresentationBuildTasks (17)
MS\Internal\MarkupCompiler\PathInternal.cs (1)
108if (sb.Length > 0)
src\wpf\src\Microsoft.DotNet.Wpf\src\PresentationFramework\MS\Internal\Globalization\LocalizationComments.cs (6)
93if (tokenBuffer.Length > 0) 133if (tokenBuffer.Length == 0) 155currentPair.Value = tokenBuffer.ToString(1, tokenBuffer.Length - 1); 189if (currentPair.PropertyName != null || tokenBuffer.Length != 0) 215if (builder.Length > 0) 231if (builder.Length > 0)
src\wpf\src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\MarkupExtensionParser.cs (5)
1061if (stringBuilder.Length != 0) 1083if (stringBuilder != null && stringBuilder.Length > 0) 1126if (stringBuilder.Length > 0) 1181Debug.Assert(sb.Length > 0); 1184int i = sb.Length-1;
src\wpf\src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\XamlReaderHelper.cs (5)
1261for (int i = 0; i < textValueStringBuilder.Length; i++) 1278if (!lastTextWasPreserved && textValueStringBuilder.Length > 0) 1280char lastChar = textValueStringBuilder[textValueStringBuilder.Length - 1]; 1284textValueStringBuilder.Remove(textValueStringBuilder.Length - 1, 1); 1288if (textValueStringBuilder.Length > 0)
PresentationCore (7)
MS\Internal\FontFace\FontDifferentiator.cs (3)
66if (faceNameBuilder.Length > 0) 75if (faceNameBuilder.Length > 0) 82if (faceNameBuilder.Length == 0)
MS\Internal\TextFormatting\TextStore.cs (2)
2287Invariant.Assert(stringBuilder.Length == cchText); 2289char[] rawText = new char[stringBuilder.Length];
System\Windows\Media\GlyphsSerializer.cs (2)
138int length = sb.Length; 154Debug.Assert(_glyphStringBuider.Length == 0);
PresentationFramework (17)
MS\Internal\Data\PropertyPathWorker.cs (1)
1279Debug.Assert(sb.Length == 0,
MS\Internal\Globalization\BamlTreeUpdater.cs (1)
389if (textContent.Length > 0)
MS\Internal\Globalization\LocalizationComments.cs (6)
93if (tokenBuffer.Length > 0) 133if (tokenBuffer.Length == 0) 155currentPair.Value = tokenBuffer.ToString(1, tokenBuffer.Length - 1); 189if (currentPair.PropertyName != null || tokenBuffer.Length != 0) 215if (builder.Length > 0) 231if (builder.Length > 0)
System\Windows\Controls\DataGridClipboardHelper.cs (1)
23int length = sb.Length;
System\Windows\Documents\RtfToXamlReader.cs (2)
8442for (int uriIndex = 0; uriIndex < sb.Length; uriIndex++) 8444if (sb[uriIndex] == '\\' && uriIndex + 1 < sb.Length && sb[uriIndex + 1] == '\\')
System\Windows\Markup\MarkupExtensionParser.cs (5)
1061if (stringBuilder.Length != 0) 1083if (stringBuilder != null && stringBuilder.Length > 0) 1126if (stringBuilder.Length > 0) 1181Debug.Assert(sb.Length > 0); 1184int i = sb.Length-1;
System\Windows\Markup\Primitives\MarkupWriter.cs (1)
1646if (r.Length > 0)
ReachFramework (7)
MS\Internal\Printing\Configuration\COMPSTUISRID.cs (2)
39resString.Length = Math.Max(0, Math.Min(charCount, resString.Length)); 42for (int i = 0; i < resString.Length - 1; i++)
PrintSystemExceptions\PrintSystemException.cs (1)
284if(charCount < win32ErrorMessage.Length)
Serialization\VisualSerializer.cs (4)
187if (rslt.Length != 0) 204if (rslt.Length != 0) 241if (rslt.Length == 0) 1227if (rslt.Length == 0)
Roslyn.Diagnostics.Analyzers (5)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\Hash.cs (1)
336int end = text.Length;
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\StringTable.cs (1)
500if (array.Length != text.Length)
src\roslyn\src\Dependencies\PooledObjects\PooledStringBuilder.cs (2)
40get { return this.Builder.Length; } 108Debug.Assert(builder.Builder.Length == 0);
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (1)
185if (currentXmlComment.Length > 0)
Roslyn.Diagnostics.CSharp.Analyzers (2)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTriviaExtensions.cs (1)
109textBuilder.Remove(textBuilder.Length - newLine.Length, newLine.Length);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\CSharpFormattingOptions2.Parsers.cs (1)
55if (builder.Length > 0)
Roslyn.Diagnostics.VisualBasic.Analyzers (2)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\ExpressionGenerator.StringPiece.vb (2)
102If sb.Length > 0 Then 132If sb.Length > 0 Then
Security.TransportSecurity.IntegrationTests (4)
Https\HttpsTests.4.1.0.cs (4)
103Assert.True(errorBuilder.Length == 0, "Test case FAILED with errors: " + errorBuilder.ToString()); 142Assert.True(errorBuilder.Length == 0, "Test case FAILED with errors: " + errorBuilder.ToString()); 181Assert.True(errorBuilder.Length == 0, "Test case FAILED with errors: " + errorBuilder.ToString()); 220Assert.True(errorBuilder.Length == 0, "Test case FAILED with errors: " + errorBuilder.ToString());
System.CommandLine (1)
Help\HelpBuilder.cs (1)
314if (sb.Length > 0)
System.ComponentModel.Composition (3)
System\ComponentModel\Composition\ContractNameServices.cs (2)
51typeIdentityStringBuilder.Remove(typeIdentityStringBuilder.Length - 1, 1); 267typeName.Remove(typeName.Length - 1, 1);
System\ComponentModel\Composition\Hosting\TypeCatalog.cs (1)
377if (builder.Length > 0)
System.ComponentModel.TypeConverter (47)
System\ComponentModel\MaskedTextProvider.cs (47)
428_testString.Capacity = _testString.Length; 490for (int position = 0; position < _testString.Length; position++) 616public int LastAssignedPosition => FindAssignedEditPositionFrom(_testString.Length - 1, BACKWARD); 621public int Length => _testString.Length; 712for (int position = 0; position < _testString.Length; position++) 792if (index < 0 || index >= _testString.Length) 825if (lastAssignedPos == _testString.Length - 1) // at the last edit char position. 827testPosition = _testString.Length; 839testPosition = _testString.Length; 907for (int position = 0; position < _testString.Length; position++) 931endPosition = _testString.Length - 1; 971endPosition = _testString.Length - 1; 1064endPosition = _testString.Length - 1; 1099if (endPosition >= _testString.Length) 1101endPosition = _testString.Length - 1; 1140endPosition = _testString.Length - 1; 1202if (position < 0 || position >= _testString.Length) 1245if (position < 0 || position >= _testString.Length) 1266Debug.Assert(input != null && position >= 0 && position < _testString.Length, "input param out of range."); 1287if (shiftNeeded && (testPosition == _testString.Length - 1)) // no room for shifting. 1290testPosition = _testString.Length; 1307testPosition = _testString.Length; 1394if (position < 0 || position >= _testString.Length) 1408if (position < 0 || position >= _testString.Length) 1526if (endPosition >= _testString.Length) 1554Debug.Assert(startPosition >= 0 && startPosition <= endPosition && endPosition < _testString.Length, "Out of range input value."); 1688if (position < 0 || position >= _testString.Length) 1732if (endPosition >= _testString.Length) 1779if (position < 0 || position >= _testString.Length) 1814if (endPosition >= _testString.Length) 1883testPosition = _testString.Length; 1956Debug.Assert(startPosition >= 0 && endPosition >= 0 && endPosition >= startPosition && endPosition < _testString.Length, "position out of range."); 2013ResetString(resetPos, _testString.Length - 1); 2025Debug.Assert(position >= 0 && position < _testString.Length, "Position out of range."); 2037Debug.Assert(position >= 0 && position < _testString.Length, "Position out of range."); 2162Debug.Assert(position >= 0 && position < _testString.Length, "Position out of range."); 2437if (testPosition >= _testString.Length) 2450testPosition = _testString.Length; 2489StringBuilder st = new StringBuilder(_testString.Length); 2491for (int position = 0; position < _testString.Length; position++) 2506return ToString(/*ignorePwdChar*/ true, IncludePrompt, IncludeLiterals, 0, _testString.Length); 2515return ToString(ignorePasswordChar, IncludePrompt, IncludeLiterals, 0, _testString.Length); 2545return ToString( /*ignorePwdChar*/ true, includePrompt, includeLiterals, 0, _testString.Length); 2575if (startPosition >= _testString.Length) 2580int maxLength = _testString.Length - startPosition; 2672if (position < 0 || position >= _testString.Length) 2686if (position < 0 || position >= _testString.Length)
System.Configuration.ConfigurationManager (14)
System\Configuration\ConfigurationElement.cs (6)
1189if (sb.Length != 0) 1195if ((writer != null) && (sb.Length != 0)) 1197return sb.Length != 0; 1210if (sb.Length != 0) 1230if (sb.Length != 0) 1241if (sb.Length != 0)
System\Configuration\ConfigurationLockCollection.cs (1)
72if (sb.Length != 0) sb.Append(',');
System\Configuration\StringAttributeCollection.cs (2)
69if (sb.Length > 0) sb.Length--; 70return sb.Length == 0 ? null : sb.ToString();
System\Configuration\XmlUtil.cs (5)
997lineWidth = sbLengthLastNewLine - ((StringWriter)utilWriter.Writer).GetStringBuilder().Length; 1016sbLengthLastNewLine = ((StringWriter)utilWriter.Writer).GetStringBuilder().Length; 1062sbLengthLastNewLine = ((StringWriter)utilWriter.Writer).GetStringBuilder().Length; 1069int startLength = ((StringWriter)utilWriter.Writer).GetStringBuilder().Length; 1076lineWidth += ((StringWriter)utilWriter.Writer).GetStringBuilder().Length - startLength;
System.Console (4)
System\IO\CachedConsoleStream.cs (1)
55if (cache.Length > 0)
System\IO\StdInReader.cs (3)
99if (isEnter || _readLineSB.Length > 0) 115if (_readLineSB.Length == 0) 196int len = _readLineSB.Length;
System.Data.Common (6)
src\runtime\src\libraries\Common\src\System\Data\Common\AdapterUtil.cs (1)
377int start = buffer.Length;
src\runtime\src\libraries\Common\src\System\Data\Common\DbConnectionOptions.Common.cs (2)
151int count = buffer.Length; 161int count = buffer.Length;
System\Data\Common\DbConnectionOptions.cs (2)
69if ((0 < builder.Length) && (';' != builder[builder.Length - 1]))
System\Data\DataTable.cs (1)
3074if (0 < builder.Length)
System.Data.Odbc (12)
Common\System\Data\Common\DbConnectionOptions.cs (3)
131if ((0 < builder.Length) && (';' != builder[builder.Length - 1])) 395position = builder.Length;
src\runtime\src\libraries\Common\src\System\Data\Common\AdapterUtil.cs (1)
377int start = buffer.Length;
src\runtime\src\libraries\Common\src\System\Data\Common\DbConnectionOptions.Common.cs (2)
151int count = buffer.Length; 161int count = buffer.Length;
System\Data\Odbc\OdbcException.cs (1)
21if (builder.Length > 0)
System\Data\Odbc\OdbcInfoMessageEvent.cs (1)
31if (0 < builder.Length) { builder.Append(Environment.NewLine); }
System\Data\Odbc\OdbcUtils.cs (4)
384if (_token.Length != 0) 386_idx += _token.Length; // proceed the internal marker (_idx) behind the token 387_token.Remove(0, _token.Length); // and start over with a fresh token 451return (_token.Length > 0) ? _token.ToString() : string.Empty;
System.Data.OleDb (15)
DbConnectionOptions.cs (5)
196if ((0 < builder.Length) && (';' != builder[builder.Length - 1])) 469position = builder.Length; 504int count = buffer.Length; 514int count = buffer.Length;
OleDb_Util.cs (10)
116if (0 < builder.Length) 121if (0 < builder.Length) 126if (0 < builder.Length) 131if (0 < builder.Length) 136if (0 < builder.Length) 141if (0 < builder.Length) 146if (0 < builder.Length) 151if (0 < builder.Length) 156if (0 < builder.Length) 161if (0 < builder.Length)
System.Diagnostics.DiagnosticSource (1)
System\Diagnostics\DistributedContextPropagator.cs (1)
143setter(carrier, CorrelationContext, baggageList.ToString(0, baggageList.Length - 2));
System.Diagnostics.EventLog (3)
System\Diagnostics\EventLog.cs (1)
850if (sb.Length > 0)
System\Diagnostics\EventLogEntry.cs (2)
432if (result.Length == 0) 438return result.ToString(0, result.Length - 1);
System.Diagnostics.Process (2)
System\Diagnostics\AsyncStreamReader.cs (2)
132if (_sb!.Length != 0) 153int len = _sb!.Length;
System.DirectoryServices (3)
Interop\AdsValueHelper2.cs (1)
153strb.Append(binaryPart.Length);
System\DirectoryServices\ActiveDirectory\Utils.cs (2)
1417if (roNtdsaFilter.Length > 0) 1438if (roNtdsaFilter.Length > 0)
System.DirectoryServices.AccountManagement (8)
System\DirectoryServices\AccountManagement\AD\ADStoreCtx_LoadStore.cs (3)
1245if (sb.Length > 0) 1246sb.Remove(sb.Length - 1, 1); 1248string s = (sb.Length > 0) ? sb.ToString() : null;
System\DirectoryServices\AccountManagement\AD\ADUtils.cs (2)
129if (sb[sb.Length - 1] == ' ') 131sb.Remove(sb.Length - 1, 1);
System\DirectoryServices\AccountManagement\AD\SDSUtils.cs (2)
798if (sb.Length > 0) 799sb.Remove(sb.Length - 1, 1);
System\DirectoryServices\AccountManagement\SAM\SAMMembersSet.cs (1)
166adsPath.Remove(adsPath.Length - 1, 1); // remove the trailing "/"
System.DirectoryServices.Protocols (1)
System\DirectoryServices\Protocols\ldap\LdapConnection.Linux.cs (1)
69if (temp.Length != 0)
System.IO.Ports (3)
System\IO\Ports\SerialPort.cs (3)
1108if (lastValueChar == (char)_singleCharBuffer[numCharsRead - 1] && (currentLine.Length >= value.Length)) 1115if (value[value.Length - i] != currentLine[currentLine.Length - i]) 1125string ret = currentLine.ToString(0, currentLine.Length - value.Length);
System.Net.Http (2)
System\Net\Http\Headers\CacheControlHeaderValue.cs (1)
565if (sb.Length > 0)
System\Net\Http\Headers\NameValueHeaderValue.cs (1)
177if (leadingSeparator || (destination.Length > 0))
System.Net.Http.WinHttpHandler (2)
src\runtime\src\libraries\Common\src\Interop\Windows\WinHttp\Interop.winhttp.cs (1)
69int length = builder.Length + 1;
System\Net\Http\WinHttpHandler.cs (1)
765(uint)requestHeadersBuffer.Length,
System.Net.HttpListener (6)
System\Net\Managed\ChunkStream.cs (5)
264if (_saved.Length > 20) 275if (_saved.Length > 0) 336if (_trailerState == 2 && (char)buffer[offset] == '\r' && _saved.Length == 0) 366_saved.Append(stString.AsSpan(0, _saved.Length == 0 ? st - 2 : st)); 368if (_saved.Length > 4196)
System\Net\Managed\HttpListenerResponse.Managed.cs (1)
299int startingLength = sb.Length;
System.Net.Mail (3)
System\Net\Mail\SmtpClient.cs (1)
138if (sb.Length > 0)
System\Net\Mail\SmtpReplyReaderFactory.cs (2)
315lines.Add(new LineInfo(_statusCode, builder.ToString(0, builder.Length - 2))); // Exclude CRLF 327lines!.Add(new LineInfo(_statusCode, builder.ToString(0, builder.Length - 2))); // return everything except CRLF
System.Net.Primitives (2)
System\Net\Cookie.cs (2)
652int beforeLength = sb.Length; 699int afterLength = sb.Length;
System.Net.Requests (3)
System\Net\CommandStream.cs (2)
604if ((szResponse.Length + state.Resp.StatusBuffer.Length) > MaxResponseLength) 618int unusedChars = state.Resp.StatusBuffer.Length - completeLength;
System\Net\FtpControlStream.cs (1)
1184if (response.StatusBuffer.Length < 4)
System.Private.CoreLib (81)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\ManifestBuilder.cs (4)
40int pos = sb.Length; 42sb.Replace('.', '_', pos, sb.Length - pos).Replace("-", "", pos, sb.Length - pos); 518if (templates?.Length > 0)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\CharUnicodeInfo.cs (2)
57Debug.Assert(index >= 0 && index < s.Length, "index < s.Length"); 64if (index < s.Length - 1)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\IdnMapping.cs (12)
602if (output.Length - iOutputAfterLastDot > c_labelLimit) 610iOutputAfterLastDot = output.Length; 614if (output.Length > c_defaultNameLimit - (IsDot(unicode[^1]) ? 0 : 1)) 851bias = Adapt(i - oldi, (output.Length - iOutputAfterLastDot - numSurrogatePairs) + 1, oldi == 0); 855Debug.Assert((output.Length - iOutputAfterLastDot - numSurrogatePairs) + 1 > 0, 857if (i / ((output.Length - iOutputAfterLastDot - numSurrogatePairs) + 1) > c_maxint - n) 859n += (int)(i / (output.Length - iOutputAfterLastDot - numSurrogatePairs + 1)); 860i %= (output.Length - iOutputAfterLastDot - numSurrogatePairs + 1); 878if (iUseInsertLocation >= output.Length) 913for (int iTest = iOutputAfterLastDot; iTest < output.Length; iTest++) 943iOutputAfterLastDot = output.Length; 947if (output.Length > c_defaultNameLimit - (IsDot(output[^1]) ? 0 : 1))
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\TextReader.cs (1)
190if (sb.Length > 0)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\TypeNameBuilder.cs (2)
43_str.Remove(_str.Length - 1, 1); 196_stack.Add(_str.Length);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\DecoderFallback.cs (1)
302if (strBytes.Length > 0)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\StringBuilder.cs (51)
276if (value < Length) 319if (Length == 0) 324string result = string.FastAllocateString(Length); 360int currentLength = this.Length; 402/// After the call, <paramref name="source"/> has <see cref="Length"/> and 445int delta = value - Length; 457int capacityToPreserve = Math.Min(Capacity, Math.Max(Length * 6 / 5, m_ChunkChars.Length)); 481Debug.Assert(Length == value, "Something went wrong setting Length."); 490if ((uint)index >= (uint)Length) 500if ((uint)index >= (uint)Length) 712if ((uint)(repeatCount + Length) > (uint)m_MaxCapacity) 820if (value != null && value.Length != 0) 822return AppendCore(value, 0, value.Length); 846if (count > value.Length - startIndex) 861int newLength = Length + count; 913if ((uint)sourceIndex > (uint)Length) 918if (sourceIndex > Length - count) 964int currentLength = Length; 978if (insertingChars > MaxCapacity - this.Length) 982Debug.Assert(insertingChars + this.Length < int.MaxValue); 1005if (length > Length - startIndex) 1010if (Length == length && startIndex == 0) 1333if ((uint)index > (uint)Length) 1360if ((uint)index > (uint)Length) 1386if ((uint)index > (uint)Length) 1400int currentLength = Length; 1453if ((uint)index > (uint)Length) 1992public StringBuilder Replace(string oldValue, string? newValue) => Replace(oldValue, newValue, 0, Length); 2003public StringBuilder Replace(ReadOnlySpan<char> oldValue, ReadOnlySpan<char> newValue) => Replace(oldValue, newValue, 0, Length); 2015if (Length != sb.Length) 2075if (span.Length != Length) 2098Debug.Assert(offset == Length); 2132int currentLength = Length; 2249return Replace(oldChar, newChar, 0, Length); 2261int currentLength = Length; 2309return Replace(oldRune, newRune, 0, Length); 2388int newLength = Length + valueCount; 2422Debug.Assert((uint)index <= (uint)Length, "Callers should check that index is a legal value."); 2590Debug.Assert(0 <= index && index <= Length); 2632Debug.Assert(Capacity == Length, nameof(ExpandByABlock) + " should only be called when there is no space left."); 2637if ((minBlockCharCount + Length) > m_MaxCapacity || minBlockCharCount + Length < minBlockCharCount) 2646int newBlockLength = Math.Max(minBlockCharCount, Math.Min(Length, MaxChunkSize)); 2726if (count + Length > m_MaxCapacity || count + Length < count) 2818Debug.Assert(startIndex >= 0 && startIndex < Length); 2914ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(index, Length); 2918Span<char> chars = index + 1 < Length 3158int start = _stringBuilder.Length; 3160int paddingRequired = -alignment - (_stringBuilder.Length - start);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\StringBuilderRuneEnumerator.cs (1)
45if ((uint)_nextIndex >= _stringBuilder.Length)
System\Diagnostics\StackFrame.NativeAot.cs (1)
270return sb.Length > 0 ? sb.ToString() : null;
System\Diagnostics\StackTrace.NativeAot.cs (2)
91if (traceFormat == TraceFormat.Normal && builder.Length >= Environment.NewLine.Length) 94if (traceFormat == TraceFormat.TrailingNewLine && builder.Length == 0)
System\Reflection\Runtime\General\MetadataReaderExtensions.NativeFormat.cs (2)
636int index = fullName.Length; 641ReverseStringInStringBuilder(fullName, 0, fullName.Length);
System\Runtime\InteropServices\PInvokeMarshal.cs (1)
307int length = stringBuilder.Length;
System\Text\StringBuilder.NativeAot.cs (1)
89len = Length;
System.Private.DataContractSerialization (4)
System\Runtime\Serialization\Json\XmlObjectSerializerReadContextComplexJson.cs (1)
327if (stringBuilder.Length != 0)
System\Runtime\Serialization\XmlObjectSerializerReadContext.cs (1)
255if (stringBuilder.Length != 0)
System\Xml\XmlDictionaryReader.cs (2)
411if (sb.Length > maxStringContentLength - value.Length) 480if (sb.Length > maxStringContentLength - value.Length)
System.Private.StackTraceMetadata (8)
Internal\StackTraceMetadata\MethodNameFormatter.cs (8)
264int charsWritten = _outputBuilder.Length; 266if (_outputBuilder.Length - charsWritten > 0) 278int charsWritten = _outputBuilder.Length; 280if (_outputBuilder.Length - charsWritten > 0) 305int charsWritten = _outputBuilder.Length; 307if (_outputBuilder.Length - charsWritten > 0) 328int charsWritten = _outputBuilder.Length; 330if (_outputBuilder.Length - charsWritten > 0)
System.Private.Uri (1)
System\Uri.cs (1)
4672if (relPath.Length == 0 && path2.Length - 1 == si)
System.Private.Xml (66)
System\Xml\Core\XmlTextReaderImpl.cs (23)
2166Debug.Assert(_stringBuilder.Length == 0); 3626Debug.Assert(_stringBuilder.Length == 0 || isTextDecl); 3635int originalSbLen = sb.Length; 5113Debug.Assert(_stringBuilder.Length == 0); 5210int valueChunkLen = _stringBuilder.Length - valueChunkStartPos; 5237valueChunkStartPos = _stringBuilder.Length; 5254int valueChunkLen = _stringBuilder.Length - valueChunkStartPos; 5349valueChunkStartPos = _stringBuilder.Length; 5362int valueChunkLen = _stringBuilder.Length - valueChunkStartPos; 5412Debug.Assert(_stringBuilder.Length == 0); 5452Debug.Assert(_stringBuilder.Length > 0); 5493} while (!fullValue && orChars <= 0x20 && _stringBuilder.Length < MinWhitespaceLookahedCount); 5496XmlNodeType nodeType = (_stringBuilder.Length < MinWhitespaceLookahedCount) ? GetTextNodeType(orChars) : XmlNodeType.Text; 5781Debug.Assert(_stringBuilder.Length == 0); 5796Debug.Assert(_stringBuilder.Length > 0); 5910Debug.Assert(_stringBuilder.Length == 0); 5929if (_stringBuilder.Length > 0) 6213Debug.Assert(_stringBuilder.Length == 0); 6284Debug.Assert(_stringBuilder.Length == 0); 6487Debug.Assert(_stringBuilder.Length == 0); 8589Debug.Assert(_stringBuilder.Length == 0); 8643if (_stringBuilder.Length == 0) 8700if (_stringBuilder.Length > 0)
System\Xml\Core\XmlTextReaderImplAsync.cs (20)
1193Debug.Assert(_stringBuilder.Length == 0 || isTextDecl); 1202int originalSbLen = sb.Length; 2613Debug.Assert(_stringBuilder.Length == 0); 2716int valueChunkLen = _stringBuilder.Length - valueChunkStartPos; 2743valueChunkStartPos = _stringBuilder.Length; 2760int valueChunkLen = _stringBuilder.Length - valueChunkStartPos; 2855valueChunkStartPos = _stringBuilder.Length; 2869int valueChunkLen = _stringBuilder.Length - valueChunkStartPos; 2899Debug.Assert(_stringBuilder.Length == 0); 2967Debug.Assert(_stringBuilder.Length == 0); 3018Debug.Assert(_stringBuilder.Length > 0); 3064} while (!fullValue && orChars <= 0x20 && _stringBuilder.Length < MinWhitespaceLookahedCount); 3067XmlNodeType nodeType = (_stringBuilder.Length < MinWhitespaceLookahedCount) ? GetTextNodeType(orChars) : XmlNodeType.Text; 3529Debug.Assert(_stringBuilder.Length == 0); 3555Debug.Assert(_stringBuilder.Length > 0); 3677Debug.Assert(_stringBuilder.Length == 0); 3695if (_stringBuilder.Length > 0) 3908Debug.Assert(_stringBuilder.Length == 0); 3988Debug.Assert(_stringBuilder.Length == 0); 4202Debug.Assert(_stringBuilder.Length == 0);
System\Xml\Dom\XmlNode.cs (1)
780if (firstChildTextLikeNode != null && sb.Length > 0)
System\Xml\Schema\DtdParser.cs (3)
2415if (_stringBuilder.Length > 0) 3183if (_stringBuilder.Length == 0) 3197string val = (_stringBuilder.Length == 0) ? new string(_chars, _tokenStartPos, _curPos - _tokenStartPos - 1) : _stringBuilder.ToString();
System\Xml\Schema\DtdParserAsync.cs (1)
1861if (_stringBuilder.Length > 0)
System\Xml\Schema\XmlSchemaValidator.cs (2)
875if (_textValue.Length > 0) 2636Debug.Assert(builder.Length != 0);
System\Xml\Schema\XmlValueConverter.cs (1)
3110if (bldr.Length != 0)
System\Xml\Serialization\CodeIdentifier.cs (1)
298if (sb.Length != originalIdentifier.Length)
System\Xml\Serialization\Mappings.cs (1)
1156if (anyNamespaces.Length > 0)
System\Xml\Serialization\ReflectionXmlSerializationWriter.cs (1)
1077if (sb.Length != 0)
System\Xml\Serialization\Xmlcustomformatter.cs (2)
228if (sb.Length != 0) 239if (sb.Length == 0 && iZero >= 0)
System\Xml\Serialization\XmlSerializationWriter.cs (1)
1299if (arrayDims.Length > 0)
System\Xml\Xsl\Runtime\DecimalFormatter.cs (4)
76lastDigitIndex = temp.Length; 87lastDigitIndex = temp.Length; 139decimalIndex = temp.Length; 147commaIndex = temp.Length;
System\Xml\Xsl\Xslt\QilGenerator.cs (1)
1025if (_unescapedText.Length == 0)
System\Xml\Xsl\Xslt\QilStrConcatenator.cs (1)
37if (_builder.Length != 0)
System\Xml\Xsl\XsltOld\Compiler.cs (3)
806Debug.Assert(lex.Length == 0, "Builder should to be reset here"); 846Debug.Assert(lex.Length == 0, "Builder should to be reset here"); 909if (lex.Length == 0)
System.Private.Xml.Linq (1)
System\Xml\Linq\XContainer.cs (1)
949if (buffer.Length > 0)
System.Reflection.Emit (2)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\TypeNameBuilder.cs (2)
43_str.Remove(_str.Length - 1, 1); 196_stack.Add(_str.Length);
System.Reflection.Metadata (2)
System\Reflection\Internal\Utilities\PooledStringBuilder.cs (2)
30get { return this.Builder.Length; } 67Debug.Assert(builder.Builder.Length == 0);
System.Runtime.Serialization.Formatters (1)
System\Runtime\Serialization\FormatterServices.cs (1)
368return builder.Remove(builder.Length - 1, 1).Append(']').ToString();
System.Runtime.Serialization.Schema (11)
System\Runtime\Serialization\Schema\CodeExporter.cs (11)
1437for (int i = 0; i < identifier.Length && builder.Length < MaxIdentifierLength; i++) 1448if (builder.Length == 0) 1561if (builder.Length == 0) 1564int length = builder.Length; 1565if (builder[builder.Length - 1] == '.') 1577int fragmentOffset = builder.Length; 1580for (int i = 0; i < fragment.Length && builder.Length < MaxIdentifierLength; i++) 1592else if ((c == '.' || c == '/' || c == ':') && (builder.Length == 1 1593|| (builder.Length > 1 && builder[builder.Length - 1] != '.'))) 1597fragmentOffset = builder.Length;
System.Security.Cryptography.Xml (4)
System\Security\Cryptography\Xml\SignedXmlDebugLog.cs (3)
470if (validAlgorithmBuilder.Length != 0) 510if (validAlgorithmBuilder.Length != 0) 520if (validAlgorithmBuilder.Length != 0)
System\Security\Cryptography\Xml\Utils.cs (1)
162while (i < sb.Length)
System.ServiceModel.NetFramingBase (4)
System\ServiceModel\Security\SecurityUtilsEx.cs (4)
127if (str.Length > 0) 134if (str.Length <= 0) 149if (str.Length > 0) 157return str.Length <= 0 ? String.Empty : str.ToString();
System.ServiceModel.NetTcp (1)
System\ServiceModel\Channels\SocketConnection.cs (1)
925if (addressStringBuilder.Length > 0)
System.ServiceModel.Primitives (10)
Internals\System\Runtime\UrlUtility.cs (1)
604if (s.Length > 0)
Internals\System\Xml\XmlMtomReader.cs (1)
273if (expectedCharSetStr.Length != 0)
System\ServiceModel\Channels\AddressHeader.cs (1)
86builder.Remove(0, builder.Length);
System\ServiceModel\Channels\AddressHeaderCollection.cs (1)
174builder.Remove(0, builder.Length);
System\ServiceModel\Channels\BindingContext.cs (1)
107if (builder.Length > 0)
System\ServiceModel\Channels\ChannelRequirements.cs (2)
272if (contractChannelTypes.Length > 0) 316if (bindingChannelTypes.Length > 0)
System\ServiceModel\Dispatcher\ChannelDispatcher.cs (1)
495if (endpointContractNames.Length > 0)
System\ServiceModel\Dispatcher\EndpointAddressProcessor.cs (2)
123valueLength = builder.Length; 152int len = builder.Length - startLength;
System.ServiceModel.Primitives.Tests (1)
Description\OperationBehaviorTest.cs (1)
37Assert.True(MyOperationBehavior.errorBuilder.Length == 0, "Test case FAILED with errors: " + MyOperationBehavior.errorBuilder.ToString());
System.ServiceModel.Syndication (5)
System\ServiceModel\Syndication\DateTimeHelper.cs (4)
75if (dateTimeStringBuilder.Length < 18) 81for (timeZoneStartIndex = dateTimeStringBuilder.Length - 1; dateTimeStringBuilder[timeZoneStartIndex] != ' '; timeZoneStartIndex--) 85int timeZoneLength = dateTimeStringBuilder.Length - timeZoneStartIndex; 138if (result.Length == 4)
System\ServiceModel\Syndication\Rss20FeedFormatter.cs (1)
186sb.Remove(sb.Length - 3, 1);
System.Speech (13)
Internal\GrammarBuilding\BuilderElements.cs (1)
213if (sb.Length > 0)
Internal\GrammarBuilding\OneOfElement.cs (1)
57if (sb.Length > 0)
Internal\SrgsCompiler\AppDomainGrammarProxy.cs (1)
252sb.Append(sb.Length > 0 ? " or sapi:parms=\"" : "sapi:parms=\"");
Internal\SrgsCompiler\CustomGrammar.cs (2)
107bool has_script = _script.Length > 0 || _codebehind.Count > 0; 112if (rule.Script.Length > 0)
Internal\Synthesis\EngineSite.cs (2)
394int prefixSeek = _phonemes.Length + 1; 419} while (prefixSeek <= _phonemes.Length);
Internal\Synthesis\VoiceSynthesis.cs (1)
252while (start + length > sb.Length);
Recognition\GrammarBuilder.cs (1)
423if (sb.Length > 0)
Result\RecognizedPhrase.cs (4)
118while (sb.Length > 0 && sb[sb.Length - 1] == ' ') 120sb.Remove(sb.Length - 1, 1); 499if (sb.Length > 0)
System.Text.Json (2)
System\Text\Json\ThrowHelper.Serialization.cs (2)
335if (builder.Length > 0) 345return builder.Length < CutOffLength;
System.Text.Json.SourceGeneration (2)
JsonSourceGenerator.Emitter.cs (1)
1394if (wrapperParams.Length > 0)
src\runtime\src\libraries\Common\src\SourceGenerators\SourceWriter.cs (1)
66Debug.Assert(_indentation == 0 && _sb.Length > 0);
System.Text.RegularExpressions (10)
System\Text\RegularExpressions\RegexCharClass.cs (4)
1641int categoriesLength = current._categories?.Length ?? 0; 1744(_categories is null || _categories.Length == 0)) 1786_categories?.Length > 0 && 1802_categories?.Length > 0 &&
System\Text\RegularExpressions\RegexInterpreterCode.cs (1)
234string Indent() => new string(' ', Math.Max(1, 25 - sb.Length));
System\Text\RegularExpressions\RegexPrefixAnalyzer.cs (4)
38if (results.Count > MaxPrefixes || !results.TrueForAll(sb => sb.Length >= MinPrefixLength)) 64!results.TrueForAll(sb => sb.Length < MaxPrefixLength) || 273if (sb.Length == 0) 299if (results.Count == 1 && results[0].Length == 0)
System\Text\RegularExpressions\Symbolic\SymbolicRegexMatcher.Sample.cs (1)
165if (!transitionSucceeded || states.NfaStateSet.Count == 0 || inputSoFar.Length > SampleMatchesMaxInputLength)
System.Text.RegularExpressions.Generator (11)
RegexGenerator.Emitter.cs (2)
852int additionalDeclarationsPosition = ((StringWriter)writer.InnerWriter).GetStringBuilder().Length; 1650int additionalDeclarationsPosition = ((StringWriter)writer.InnerWriter).GetStringBuilder().Length;
src\runtime\src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexCharClass.cs (4)
1641int categoriesLength = current._categories?.Length ?? 0; 1744(_categories is null || _categories.Length == 0)) 1786_categories?.Length > 0 && 1802_categories?.Length > 0 &&
src\runtime\src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexPrefixAnalyzer.cs (4)
38if (results.Count > MaxPrefixes || !results.TrueForAll(sb => sb.Length >= MinPrefixLength)) 64!results.TrueForAll(sb => sb.Length < MaxPrefixLength) || 273if (sb.Length == 0) 299if (results.Count == 1 && results[0].Length == 0)
Stubs.cs (1)
28var chars = new char[stringBuilder.Length];
System.Web.HttpUtility (2)
System\Web\HttpUtility.cs (2)
77return sb.Length > 0 ? sb.ToString(0, sb.Length - 1) : "";
System.Windows.Forms (10)
System\Windows\Forms\Application.cs (1)
1479currentStartInfo.Arguments = sb.ToString(0, sb.Length - 1);
System\Windows\Forms\Controls\DataGridView\DataGridViewCell.cs (1)
1356int insertionPoint = sb.Length;
System\Windows\Forms\Controls\DataGridView\DataGridViewColumnHeaderCell.cs (1)
179int insertionPoint = stringBuilder.Length;
System\Windows\Forms\Controls\DataGridView\DataGridViewRowHeaderCell.cs (1)
151int insertionPoint = stringBuilder.Length;
System\Windows\Forms\Controls\ToolStrips\ToolStripSettingsManager.cs (1)
87return itemNames.ToString(0, itemNames.Length - 1);
System\Windows\Forms\DataBinding\BindingSource.cs (1)
480return sb.ToString(0, sb.Length - 1);
System\Windows\Forms\Panels\TableLayoutPanel\TableLayoutSettingsTypeConverter.cs (4)
102if (columnStyles.Length > 0) 104columnStyles.Remove(columnStyles.Length - 1, 1); 118if (rowStyles.Length > 0) 120rowStyles.Remove(rowStyles.Length - 1, 1);
System.Windows.Forms.Analyzers.CSharp (1)
System\Windows\Forms\CSharp\Generators\ApplicationConfiguration\ApplicationConfigurationInitializeBuilder.cs (1)
41code.Remove(code.Length - "\r\n".Length, "\r\n".Length);
System.Windows.Forms.Design (2)
System\Windows\Forms\Design\ToolStripDesigner.cs (2)
1723if (name.Length == 0) 1751if (name.Length == 0)
System.Windows.Input.Manipulations (3)
System\Windows\Input\Manipulations\InertiaProcessor2D.cs (1)
1093if (log.Length < 1000000)
System\Windows\Input\Manipulations\ManipulationSequence.cs (2)
355if (this.log.Length >= 100000) 592Debug.Assert(this.log.Length > 0); // makes a good breakpoint to read the log
System.Xaml (7)
System\Xaml\Parser\XamlText.cs (4)
40get { return _sb.Length==0; } 124if (_sb.Length > 0) 134if (IsWhitespaceChar(_sb[_sb.Length-1])) 168int length = _sb.Length;
System\Xaml\XamlObjectReader.cs (1)
605if (sb.Length > 0)
System\Xaml\XamlSchemaContext.cs (1)
190if (sb.Length > 0)
System\Xaml\XamlXmlWriter.cs (1)
612if (builder.Length != 0)
UnitTests.Common (2)
TestHelpers.cs (2)
109return errorBuilder.Length == 0 ? null : errorBuilder.ToString(); 217return errorBuilder.Length == 0 ? null : errorBuilder.ToString();
VBCSCompiler (1)
src\roslyn\src\Compilers\Server\VBCSCompiler\CompilationCache.cs (1)
435return diff.Length > 0 ? diff.ToString() : "(no differences)";