192 writes to 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;
Metrics (2)
src\RoslynAnalyzers\Utilities\Compiler\WordParser.cs (2)
294_buffer.Length = 0; 604_buffer.Length--;
Metrics.Legacy (2)
src\RoslynAnalyzers\Utilities\Compiler\WordParser.cs (2)
294_buffer.Length = 0; 604_buffer.Length--;
Microsoft.AspNetCore.Authentication.Twitter (3)
TwitterHandler.cs (3)
220stringBuilder.Length--; 242stringBuilder.Length--; 252stringBuilder.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)
445builder.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)
FileUtilities.cs (1)
1221sb.Length--;
Logging\BaseConsoleLogger.cs (1)
1252shared.Length = 0;
Logging\BinaryLogger\BuildEventArgsReader.cs (1)
1897stringBuilder!.Length = position.StringLength;
Microsoft.Build.Engine.OM.UnitTests (1)
FileUtilities.cs (1)
1221sb.Length--;
Microsoft.Build.Framework (2)
ReuseableStringBuilder.cs (1)
61_borrowedBuilder.Length = value;
StringBuilderCache.cs (1)
52sb.Length = 0; // Equivalent of sb.Clear() that works on .Net 3.5
Microsoft.Build.Tasks.CodeAnalysis (2)
src\Compilers\Core\Portable\InternalUtilities\CommandLineUtilities.cs (2)
65builder.Length = 0; 85builder.Length = 0;
Microsoft.Build.Tasks.Core (4)
FileUtilities.cs (1)
1221sb.Length--;
GenerateResource.cs (3)
3611name.Length = 0; 3635name.Length--; 3646value.Length = 0;
Microsoft.Build.Utilities.Core (1)
FileUtilities.cs (1)
1221sb.Length--;
Microsoft.CodeAnalysis (5)
CommandLine\CommandLineParser.cs (2)
598stringBuilder.Builder.Length = 0; 616stringBuilder.Builder.Length = 0;
InternalUtilities\CommandLineUtilities.cs (2)
65builder.Length = 0; 85builder.Length = 0;
Syntax\SyntaxDiffer.cs (1)
836builder.Length = 0;
Microsoft.CodeAnalysis.Analyzers (2)
src\RoslynAnalyzers\Utilities\Compiler\WordParser.cs (2)
294_buffer.Length = 0; 604_buffer.Length--;
Microsoft.CodeAnalysis.AnalyzerUtilities (2)
src\RoslynAnalyzers\Utilities\Compiler\WordParser.cs (2)
294_buffer.Length = 0; 604_buffer.Length--;
Microsoft.CodeAnalysis.BannedApiAnalyzers (2)
src\RoslynAnalyzers\Utilities\Compiler\WordParser.cs (2)
294_buffer.Length = 0; 604_buffer.Length--;
Microsoft.CodeAnalysis.CSharp (3)
Parser\Lexer_RawStringLiteral.cs (1)
59_builder.Length = 0;
Parser\Lexer_StringLiteral.cs (2)
36_builder.Length = 0; 195_builder.Length = 0;
Microsoft.CodeAnalysis.PublicApiAnalyzers (2)
src\RoslynAnalyzers\Utilities\Compiler\WordParser.cs (2)
294_buffer.Length = 0; 604_buffer.Length--;
Microsoft.CodeAnalysis.ResxSourceGenerator (2)
src\RoslynAnalyzers\Utilities\Compiler\WordParser.cs (2)
294_buffer.Length = 0; 604_buffer.Length--;
Microsoft.CodeAnalysis.Test.Utilities (1)
Platform\Custom\MetadataSignatureHelper.cs (1)
37sb.Length -= 2;
Microsoft.CodeAnalysis.VisualBasic (1)
Scanner\ScannerInterpolatedString.vb (1)
220valueBuilder.Length -= pendingWhitespace
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (2)
src\Compilers\Core\Portable\InternalUtilities\CommandLineUtilities.cs (2)
65builder.Length = 0; 85builder.Length = 0;
Microsoft.DotNet.ArcadeLogging (1)
MessageBuilder.cs (1)
28_builder.Length = 0;
Microsoft.DotNet.Helix.Sdk (1)
SendHelixJob.cs (1)
465sb.Length = 0;
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.NET.StringTools.net35 (1)
SpanBasedStringBuilder.Simple.cs (1)
148_builder.Length = 0;
MSBuild (1)
FileUtilities.cs (1)
1221sb.Length--;
MSBuildTaskHost (2)
FileUtilities.cs (1)
1221sb.Length--;
StringBuilderCache.cs (1)
52sb.Length = 0; // Equivalent of sb.Clear() that works on .Net 3.5
PresentationBuildTasks (2)
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\RoslynAnalyzers\Utilities\Compiler\WordParser.cs (2)
294_buffer.Length = 0; 604_buffer.Length--;
RunTests (1)
TestRunner.cs (1)
181line.Length = 0;
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\libraries\Common\src\System\Data\Common\DbConnectionOptions.Common.cs (2)
206buffer.Length = 0; 256buffer.Length = 0;
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\libraries\Common\src\System\Data\Common\DbConnectionOptions.Common.cs (2)
206buffer.Length = 0; 256buffer.Length = 0;
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.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)
440_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 (3)
src\libraries\System.Private.CoreLib\src\System\Globalization\DateTimeFormatInfoScanner.cs (1)
310dateWord.Length = 0;
src\libraries\System.Private.CoreLib\src\System\Text\StringBuilder.cs (2)
378this.Length = 0; 987Length = 0;
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; 3624sb.Length = originalSbLen; 3637sb.Length = 0; 4267_stringBuilder.Length = 0; 5366_stringBuilder.Length = 0; 5447_stringBuilder.Length = 0; 5452_stringBuilder.Length = 0; 5490_stringBuilder.Length = 0; 5500_stringBuilder.Length = 0; 5788_stringBuilder.Length = 0; 5922_stringBuilder.Length = 0; 6290_stringBuilder.Length = 0; 6492_stringBuilder.Length = 0; 8720_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)
2089_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)
986_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)
288_sharedStringBuilder.Length = 0;
System\Xml\Xsl\XsltOld\ReaderOutput.cs (2)
698_buffer!.Length = 0; // clean buffer 708_buffer!.Length = 0; // clean buffer
System.Security.Cryptography (1)
System\Security\Cryptography\X509Certificates\OpenSslDirectoryBasedStoreProvider.cs (1)
303pathBuilder.Length = prefixLength;
System.Text.Json (1)
System\Text\Json\Serialization\Metadata\JsonTypeInfoResolverChain.cs (1)
67sb.Length -= 2;
System.Text.Json.SourceGeneration (2)
JsonSourceGenerator.Emitter.cs (2)
932sb.Length -= 2; // delete the last ", " token 945sb.Length -= 2; // delete the last ", " token
System.Windows.Forms (3)
System\Windows\Forms\Controls\DataGridView\DataGridView.Methods.cs (3)
7177sbContent.Length = 0; 7463sbContent.Length = 0; 7907sbContent.Length = 0;
System.Windows.Input.Manipulations (3)
System\Windows\Input\Manipulations\InertiaProcessor2D.cs (1)
606log.Length = 0;
System\Windows\Input\Manipulations\ManipulationSequence.cs (2)
357this.log.Length = 0; 639this.log.Length = 0;
Test.Utilities (2)
src\RoslynAnalyzers\Utilities\Compiler\WordParser.cs (2)
294_buffer.Length = 0; 604_buffer.Length--;
Text.Analyzers (2)
src\RoslynAnalyzers\Utilities\Compiler\WordParser.cs (2)
294_buffer.Length = 0; 604_buffer.Length--;
814 references to Length
Aspire.Dashboard (2)
Components\Resize\GridColumnManager.razor.cs (1)
89if (sb.Length > 0)
ConsoleLogs\UrlParser.cs (1)
42if (builder?.Length > 0)
Aspire.Hosting (1)
ApplicationModel\ReferenceExpression.cs (1)
212public bool IsEmpty => _builder.Length == 0;
Aspire.Hosting.Redis (1)
RedisBuilderExtensions.cs (1)
179var hostString = $"{(hostsVariableBuilder.Length > 0 ? "," : string.Empty)}{redisInstance.Name}:{redisInstance.Name}:{redisInstance.PrimaryEndpoint.TargetPort}:0";
Aspire.Hosting.SqlServer (1)
SqlServerBuilderExtensions.cs (1)
286if (batchBuilder.Length > 0)
CSharpSyntaxGenerator (1)
SourceGenerator.cs (1)
183public override int Length => _builder.Length;
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)
illink (1)
Infrastructure.Common (1)
JsonSerializer.cs (1)
25sb.Remove(sb.Length - 2, 2);
InMemory.FunctionalTests (1)
src\Shared\TypeNameHelper\TypeNameHelper.cs (1)
88builder.Replace(DefaultNestedTypeDelimiter, options.NestedTypeDelimiter, builder.Length - name.Length, name.Length);
installer.tasks (1)
RegenerateDownloadTable.cs (1)
190if (sb.Length == 0)
InteractiveHost.UnitTests (1)
SynchronizedTextWriter.cs (1)
54for (int i = start, n = builder.Length - mark.Length; i <= n; i++)
Metrics (1)
src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (1)
185if (currentXmlComment.Length > 0)
Metrics.Legacy (1)
src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (1)
185if (currentXmlComment.Length > 0)
Microsoft.Analyzers.Extra (1)
CallAnalysis\Fixers\LegacyLoggingFixer.FixDetails.cs (1)
235if (char.IsLetter(ch) || (char.IsLetterOrDigit(ch) && sb.Length > 1))
Microsoft.AspNetCore.Authentication.JwtBearer.Tools.Tests (1)
src\Tools\Shared\TestHelpers\TestConsole.cs (1)
89if (_sb.Length > 0)
Microsoft.AspNetCore.Components.Endpoints (1)
Rendering\Buffering\TextChunk.cs (1)
43_charArraySegmentStart = charArraySegmentScope.Length;
Microsoft.AspNetCore.Components.WebAssembly (1)
Services\WebAssemblyConsoleLogger.cs (1)
122var len = logBuilder.Length;
Microsoft.AspNetCore.Diagnostics (1)
src\Shared\TypeNameHelper\TypeNameHelper.cs (1)
88builder.Replace(DefaultNestedTypeDelimiter, options.NestedTypeDelimiter, builder.Length - name.Length, name.Length);
Microsoft.AspNetCore.Grpc.Swagger (1)
Internal\GrpcJsonTranscodingDescriptionProvider.cs (1)
174if (sb.Length > 0)
Microsoft.AspNetCore.Hosting (1)
src\Shared\TypeNameHelper\TypeNameHelper.cs (1)
88builder.Replace(DefaultNestedTypeDelimiter, options.NestedTypeDelimiter, builder.Length - name.Length, name.Length);
Microsoft.AspNetCore.Http.Extensions (1)
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\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)
137if (builder.Length == 0 || builder[0] != '/') 199if (builder.Length == 0 || builder[0] != '/')
Microsoft.AspNetCore.OpenApi (1)
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.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\Shared\TypeNameHelper\TypeNameHelper.cs (1)
88builder.Replace(DefaultNestedTypeDelimiter, options.NestedTypeDelimiter, builder.Length - name.Length, name.Length);
Microsoft.AspNetCore.Shared.Tests (1)
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.WebSockets.ConformanceTests (1)
Autobahn\AutobahnTester.cs (1)
123Assert.True(failures.Length == 0, "Autobahn results did not meet expectations:" + Environment.NewLine + failures.ToString());
Microsoft.AspNetCore.WebUtilities (1)
FormReader.cs (1)
245if (_builder.Length >= limit)
Microsoft.Build (7)
BackEnd\Node\OutOfProcServerNode.cs (1)
756if (_internalWriter.GetStringBuilder().Length > 0)
BackEnd\TaskExecutionHost\TaskExecutionHost.cs (2)
1465if (joinedOutputs.Length > 0) 1559if (joinedOutputs.Length > 0)
Construction\Solution\SolutionProjectGenerator.cs (2)
563for (int i = 1; i < builder.Length; i++) 1657if (referenceGuids.Length > 0)
Utilities\NuGetFrameworkWrapper.cs (1)
132if (tfmList.Length == 0)
Utilities\Utilities.cs (1)
323if (sb.Length != 0)
Microsoft.Build.Framework (3)
ReuseableStringBuilder.cs (2)
55return _borrowedBuilder?.Length ?? 0; 304int returningLength = returningBuilder.Length;
StringBuilderCache.cs (1)
96MSBuildEventSource.Log.ReusableStringBuilderFactoryStop(hash: sb.GetHashCode(), returningCapacity: sb.Capacity, returningLength: sb.Length, type: sb.Capacity <= MAX_BUILDER_SIZE ? "sbc-return" : "sbc-discard");
Microsoft.Build.Tasks.CodeAnalysis (5)
Csc.cs (2)
466if (finalDefineConstants.Length > 0) 479if (finalDefineConstants.Length > 0)
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 (11)
BootstrapperUtil\BootstrapperBuilder.cs (3)
776if (productsInLoop.Length > 0 && (buildQueue.Count == 0 || productsToRemove.Count == 0)) 778productsInLoop.Remove(productsInLoop.Length - 2, 2); 780productsInLoop.Remove(0, productsInLoop.Length);
CreateCSharpManifestResourceName.cs (1)
154if (manifestName.Length == 0)
CreateManifestResourceName.cs (2)
352int length = builder.Length; 367if ((builder.Length - length) == 1 && builder[length] == '_')
CreateVisualBasicManifestResourceName.cs (1)
159if (manifestName.Length == 0)
FileIO\WriteLinesToFile.cs (1)
114if (existingContents.Length == buffer.Length)
GenerateResource.cs (2)
3626if (name.Length == 0) 3633if (name[name.Length - 1] == ' ')
ManifestUtil\Util.cs (1)
95while (i < sb.Length)
Microsoft.Build.UnitTests.Shared (2)
ObjectModelHelpers.cs (2)
358if (expectedItemSpecs.Length > 0) 370if (actualItemSpecs.Length > 0)
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)
1641int 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)
696if (array.Length != text.Length)
src\Dependencies\CodeAnalysis.Debugging\CustomDebugInfoReader.cs (1)
256Debug.Assert(nameBuilder.Length == 0);
src\Dependencies\PooledObjects\PooledStringBuilder.cs (2)
31get { return this.Builder.Length; } 90Debug.Assert(builder.Builder.Length == 0);
Symbols\Attributes\AttributeUsageInfo.cs (1)
193if (builder.Builder.Length > 0)
Syntax\SyntaxDiffer.cs (5)
768newText.Remove(newText.Length - commonTrailingCount, commonTrailingCount); 795int maxChars = Math.Min(oldText.Length, newText.Length); 812if (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 (2)
MetaAnalyzers\DiagnosticDescriptorCreationAnalyzer_IdRangeAndCategoryValidation.cs (1)
114if (arg3.Length != 0)
src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (1)
185if (currentXmlComment.Length > 0)
Microsoft.CodeAnalysis.AnalyzerUtilities (1)
src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (1)
185if (currentXmlComment.Length > 0)
Microsoft.CodeAnalysis.BannedApiAnalyzers (1)
src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (1)
185if (currentXmlComment.Length > 0)
Microsoft.CodeAnalysis.CodeStyle (7)
src\Analyzers\Core\Analyzers\FileHeaders\AbstractFileHeaderHelper.cs (3)
75if (sb.Length == 0) 119if (sb.Length > 0) 123sb.Remove(sb.Length - eolLength, eolLength);
src\Compilers\Core\Portable\InternalUtilities\Hash.cs (1)
344int end = text.Length;
src\Compilers\Core\Portable\InternalUtilities\StringTable.cs (1)
696if (array.Length != text.Length)
src\Dependencies\PooledObjects\PooledStringBuilder.cs (2)
31get { return this.Builder.Length; } 90Debug.Assert(builder.Builder.Length == 0);
Microsoft.CodeAnalysis.Collections.Package (2)
src\Dependencies\PooledObjects\PooledStringBuilder.cs (2)
31get { return this.Builder.Length; } 90Debug.Assert(builder.Builder.Length == 0);
Microsoft.CodeAnalysis.CSharp (21)
BoundTree\BoundNode_Source.cs (2)
392builder.Remove(builder.Length - indentSize, indentSize); 405builder.Remove(builder.Length - indentSize, indentSize);
Parser\Directives.cs (1)
378if (sb.Length > 0)
Parser\Lexer.cs (1)
950else if (_builder.Length == 0)
Parser\Lexer_RawStringLiteral.cs (8)
371_builder.Append(currentLineWhitespace, startIndex: indentationWhitespace.Length, count: Math.Max(0, currentLineWhitespace.Length - indentationWhitespace.Length)); 396for (int i = 0, n = Math.Min(currentLineWhitespace.Length, indentationLineWhitespace.Length); i < n; i++) 432if (sb.Length < value.Length) 435for (int i = 0; i < value.Length; i++)
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)
Symbols\Source\AttributeLocation.cs (1)
47if (result.Length > 0)
Symbols\Symbol.cs (1)
985return 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 (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTriviaExtensions.cs (1)
109textBuilder.Remove(textBuilder.Length - newLine.Length, newLine.Length);
Microsoft.CodeAnalysis.CSharp.ExpressionEvaluator.ResultProvider (1)
src\ExpressionEvaluator\CSharp\Source\ResultProvider\CSharpFormatter.cs (1)
117if (builder.Length < length)
Microsoft.CodeAnalysis.CSharp.Workspaces (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTriviaExtensions.cs (1)
109textBuilder.Remove(textBuilder.Length - newLine.Length, newLine.Length);
Microsoft.CodeAnalysis.Debugging.Package (1)
CustomDebugInfoReader.cs (1)
256Debug.Assert(nameBuilder.Length == 0);
Microsoft.CodeAnalysis.EditorFeatures (2)
SignatureHelp\Presentation\Signature.cs (2)
162parameters.Add(new Parameter(this, sigHelpParameter, parameterContent, content.Length, prettyPrintedContent.Length));
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (1)
Options\OptionSerializerTests.cs (1)
149if (prevIsLower && !isLower && builder.Length > 0)
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (8)
CodeActions\CodeChangeProviderMetadataTests.cs (8)
34var passLength = failureMessage.Length; 44Assert.True(failureMessage.Length == passLength, failureMessage.ToString()); 61var passLength = failureMessage.Length; 82Assert.True(failureMessage.Length == passLength, failureMessage.ToString()); 98var passLength = failureMessage.Length; 109Assert.True(failureMessage.Length == passLength, failureMessage.ToString()); 128var passLength = failureMessage.Length; 136Assert.True(failureMessage.Length == passLength, failureMessage.ToString());
Microsoft.CodeAnalysis.ExpressionEvaluator.ResultProvider (3)
src\Compilers\Core\Portable\CaseInsensitiveComparison.cs (1)
396for (int i = 0; i < builder.Length; i++)
src\Dependencies\PooledObjects\PooledStringBuilder.cs (2)
31get { return this.Builder.Length; } 90Debug.Assert(builder.Builder.Length == 0);
Microsoft.CodeAnalysis.ExpressionEvaluator.ResultProvider.Utilities (2)
src\Dependencies\PooledObjects\PooledStringBuilder.cs (2)
31get { return this.Builder.Length; } 90Debug.Assert(builder.Builder.Length == 0);
Microsoft.CodeAnalysis.ExternalAccess.Razor.UnitTests (2)
RazorPredefinedProviderNameTests.cs (2)
28var passLength = failureMessage.Length; 46Assert.True(failureMessage.Length == passLength, failureMessage.ToString());
Microsoft.CodeAnalysis.Features (2)
DocumentationComments\AbstractDocumentationCommentFormattingService.cs (2)
578if (builder.Length == 0) 595if (builder.Length > 0)
Microsoft.CodeAnalysis.InteractiveHost (1)
src\Compilers\Core\Portable\InternalUtilities\Hash.cs (1)
344int end = text.Length;
Microsoft.CodeAnalysis.PooledObjects.Package (2)
PooledStringBuilder.cs (2)
31get { return this.Builder.Length; } 90Debug.Assert(builder.Builder.Length == 0);
Microsoft.CodeAnalysis.PublicApiAnalyzers (1)
src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (1)
185if (currentXmlComment.Length > 0)
Microsoft.CodeAnalysis.ResxSourceGenerator (1)
src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (1)
185if (currentXmlComment.Length > 0)
Microsoft.CodeAnalysis.Scripting (4)
Hosting\CommandLine\CommandLineRunner.cs (1)
249if (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.Scripting.TestUtilities (1)
TestConsoleIO.cs (1)
68if (_reader.ContentRead.Length > 0)
Microsoft.CodeAnalysis.Test.Utilities (3)
CompilationVerifier.cs (1)
247if (sb.Length > 0)
Platform\Custom\MetadataSignatureHelper.cs (2)
137int length = sb.Length; 139if (sb.Length > length)
Microsoft.CodeAnalysis.Threading.Package (2)
src\Dependencies\PooledObjects\PooledStringBuilder.cs (2)
31get { return this.Builder.Length; } 90Debug.Assert(builder.Builder.Length == 0);
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\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\ExpressionGenerator.StringPiece.vb (2)
102If sb.Length > 0 Then 132If sb.Length > 0 Then
Microsoft.CodeAnalysis.VisualBasic.EditorFeatures (1)
EndConstructGeneration\EndConstructStatementVisitor.vb (1)
192Dim finalCaretPoint = stringBuilder.Length
Microsoft.CodeAnalysis.VisualBasic.ExpressionCompiler (2)
CompilationContext.vb (2)
926If builder.Length = 0 Then 951If builder.Length = 0 Then
Microsoft.CodeAnalysis.VisualBasic.Workspaces (2)
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)
648return equivalenceKey.Length > 0 ? equivalenceKey.ToString() : null;
Log\KeyValueLogMessage.cs (1)
182if (builder.Length > 0)
src\Compilers\Core\Portable\InternalUtilities\StringTable.cs (1)
696if (array.Length != text.Length)
src\Dependencies\PooledObjects\PooledStringBuilder.cs (2)
31get { return this.Builder.Length; } 90Debug.Assert(builder.Builder.Length == 0);
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (9)
MSBuild\ProjectFile\Extensions.cs (1)
98if (builder.Length > 0)
src\Compilers\Core\Portable\CaseInsensitiveComparison.cs (1)
396for (int i = 0; i < builder.Length; i++)
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)
src\Compilers\Core\Portable\InternalUtilities\Hash.cs (1)
344int end = text.Length;
src\Compilers\Core\Portable\InternalUtilities\StringTable.cs (1)
696if (array.Length != text.Length)
src\Dependencies\PooledObjects\PooledStringBuilder.cs (2)
31get { return this.Builder.Length; } 90Debug.Assert(builder.Builder.Length == 0);
Microsoft.CodeAnalysis.Workspaces.UnitTests (1)
UtilityTest\SourceTextSerializationTests.cs (1)
52for (var i = sb.Length; i < size; i++)
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.DotNet.Build.Manifest (2)
VersionIdentifier.cs (2)
166if (versionSuffix.Length == 0 && 173else if (versionSuffix.Length != 0 && !int.TryParse(nextSegment, out int potentialVersionSegment) && nextSegment != _finalSuffix)
Microsoft.DotNet.Build.Tasks.Templating (1)
GenerateFileFromTemplate.cs (1)
139if (varNameSb.Length > 0)
Microsoft.DotNet.Helix.Sdk (2)
SendHelixJob.cs (2)
458if (prev == ';' && sb.Length != 0) 482if (sb.Length != 0)
Microsoft.DotNet.Open.Api.Tools.Tests (1)
src\Tools\Shared\TestHelpers\TestConsole.cs (1)
89if (_sb.Length > 0)
Microsoft.DotNet.PackageTesting (1)
VerifyClosure.cs (1)
332if (builder.Length > 0)
Microsoft.DotNet.RemoteExecutor (1)
PasteArguments.cs (1)
70if (stringBuilder.Length != 0)
Microsoft.DotNet.SharedFramework.Sdk (1)
src\Microsoft.DotNet.PackageTesting\VerifyClosure.cs (1)
332if (builder.Length > 0)
Microsoft.DotNet.SignCheckLibrary (1)
Verification\SignatureVerificationResult.cs (1)
261if (sb.Length > 0)
Microsoft.DotNet.SourceBuild.Tasks (2)
src\UsageReport\WriteUsageReports.cs (2)
124if (sourceBuildCreator.Length != 0) 146SourceBuildPackageIdCreator = sourceBuildCreator.Length == 0
Microsoft.Extensions.ApiDescription.Tool.Tests (1)
src\Tools\Shared\TestHelpers\TestConsole.cs (1)
89if (_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)
34Assert.Equal(0, sb.Length);
Microsoft.Extensions.Configuration.Xml (2)
XmlStreamConfigurationProvider.cs (2)
432if (_sb.Length != 0) 449_sb.Remove(_sb.Length - length, length);
Microsoft.Extensions.DependencyInjection (1)
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\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)
257var length = builder.Length; 272if ((builder.Length - length) == 1 && builder[length] == '_')
Microsoft.Extensions.Http (1)
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\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.SecretManager.Tools.Tests (1)
src\Tools\Shared\TestHelpers\TestConsole.cs (1)
89if (_sb.Length > 0)
Microsoft.Extensions.ServiceDiscovery (1)
Configuration\ConfigurationServiceEndpointProvider.Log.cs (1)
35if (endpointValues.Length > 0)
Microsoft.Extensions.Telemetry (4)
Http\HttpRouteFormatter.cs (2)
161if (formattedHttpPath.Length > 1) 163int index = formattedHttpPath.Length - 1;
Logging\ExtendedLogger.cs (2)
170return sb.Length > config.MaxStackTraceLength 183if (sb.Length > 0)
Microsoft.Extensions.Telemetry.Abstractions (2)
Logging\LoggerMessageState.cs (2)
135if (sb.Length > 0) 147if (sb.Length > 0)
Microsoft.Extensions.Telemetry.Tests (4)
Logging\ExtendedLoggerFactoryTests.cs (4)
142sb.Append(sb.Length > 0 ? $", TraceId:{activity.GetTraceId()}" : $"TraceId:{activity.GetTraceId()}"); 147sb.Append(sb.Length > 0 ? $", ParentId:{activity.GetParentId()}" : $"ParentId:{activity.GetParentId()}"); 152sb.Append(sb.Length > 0 ? $", TraceState:{activity.TraceStateString}" : $"TraceState:{activity.TraceStateString}"); 157sb.Append(sb.Length > 0 ? $", TraceFlags:{activity.ActivityTraceFlags}" : $"TraceFlags:{activity.ActivityTraceFlags}");
Microsoft.Gen.MetadataExtractor (1)
src\Generators\Microsoft.Gen.Metrics\Parser.cs (1)
864if (stringBuilder.Length != 0)
Microsoft.Gen.Metrics (1)
Parser.cs (1)
864if (stringBuilder.Length != 0)
Microsoft.Gen.MetricsReports (1)
src\Generators\Microsoft.Gen.Metrics\Parser.cs (1)
864if (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.cs (1)
180if (((this.GenerationEnvironment.Length == 0)
Template\SweepableEstimator_T_.cs (1)
185if (((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)
139if (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.Http.Headers (2)
CacheControlHeaderValue.cs (1)
799if (sb.Length > 0)
NameValueHeaderValue.cs (1)
293if (leadingSeparator || (destination.Length > 0))
Microsoft.NET.StringTools.net35 (4)
InternableString.Simple.cs (2)
119public readonly int Length => (_builder == null ? FirstString.Length : _builder.Length); 216for (int i = 0; i < _builder.Length; i++)
SpanBasedStringBuilder.Simple.cs (2)
47if (newIndex < _builder.Length) 91public int Length => _builder.Length;
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)
PresentationBuildTasks (17)
MS\Internal\MarkupCompiler\PathInternal.cs (1)
108if (sb.Length > 0)
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\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\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\XamlReaderHelper.cs (5)
1264for (int i = 0; i < textValueStringBuilder.Length; i++) 1281if (!lastTextWasPreserved && textValueStringBuilder.Length > 0) 1283char lastChar = textValueStringBuilder[textValueStringBuilder.Length - 1]; 1287textValueStringBuilder.Remove(textValueStringBuilder.Length - 1, 1); 1291if (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)
8445for (int uriIndex = 0; uriIndex < sb.Length; uriIndex++) 8447if (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 (1)
src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (1)
185if (currentXmlComment.Length > 0)
Roslyn.Test.PdbUtilities (2)
Shared\DummyMetadataImport.cs (2)
103qualifiedNameLength = qualifiedName.Length; 142qualifiedNameLength = qualifiedName.Length;
Roslyn.VisualStudio.Next.UnitTests (1)
Options\VisualStudioOptionStorageTests.cs (1)
302var stringToInsert = builder.Length == 0 ? currentGroup.Name : currentGroup.Name + ".";
RulesetToEditorconfigConverter (1)
src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (1)
185if (currentXmlComment.Length > 0)
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.ComponentModel.Composition (3)
System\ComponentModel\Composition\ContractNameServices.cs (2)
59typeIdentityStringBuilder.Remove(typeIdentityStringBuilder.Length - 1, 1); 275typeName.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\libraries\Common\src\System\Data\Common\AdapterUtil.cs (1)
380int start = buffer.Length;
src\libraries\Common\src\System\Data\Common\DbConnectionOptions.Common.cs (2)
158int count = buffer.Length; 168int 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])) 397position = builder.Length;
src\libraries\Common\src\System\Data\Common\AdapterUtil.cs (1)
380int start = buffer.Length;
src\libraries\Common\src\System\Data\Common\DbConnectionOptions.Common.cs (2)
158int count = buffer.Length; 168int 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.Diagnostics.DiagnosticSource (1)
System\Diagnostics\DistributedContextPropagator.cs (1)
139setter(carrier, CorrelationContext, baggageList.ToString(0, baggageList.Length - 2));
System.Diagnostics.Process (2)
System\Diagnostics\AsyncStreamReader.cs (2)
132if (_sb!.Length != 0) 153int len = _sb!.Length;
System.IO.FileSystem.Watcher (2)
System\IO\FileSystemWatcher.Linux.cs (2)
970if (builder.Length > 0) 972char c = builder[builder.Length - 1];
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.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 (5)
System\Net\Mail\SmtpClient.cs (1)
146if (sb.Length > 0)
System\Net\Mail\SmtpReplyReaderFactory.cs (4)
343lines.Add(new LineInfo(_statusCode, builder.ToString(0, builder.Length - 2))); // return everything except CRLF 354lines.Add(new LineInfo(_statusCode, builder.ToString(0, builder.Length - 2))); // return everything except CRLF 476_lines!.Add(new LineInfo(_parent._statusCode, _builder.ToString(0, _builder.Length - 2))); // return everything except CRLF 489_lines!.Add(new LineInfo(_parent._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 (2)
System\Net\CommandStream.cs (1)
611int unusedChars = state.Resp.StatusBuffer.Length - completeLength;
System\Net\FtpControlStream.cs (1)
1182if (response.StatusBuffer.Length < 4)
System.Net.WebSockets.Client (1)
System\Net\WebSockets\WebSocketHandle.Managed.cs (1)
440Debug.Assert(builder.Length <= ClientWebSocketDeflateConstants.MaxExtensionLength);
System.Private.CoreLib (69)
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventSource.cs (4)
5329int pos = sb.Length; 5331sb.Replace('.', '_', pos, sb.Length - pos).Replace("-", "", pos, sb.Length - pos); 5807if (templates?.Length > 0)
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\libraries\System.Private.CoreLib\src\System\Globalization\DateTimeParse.cs (1)
5298int curLineLength = buffer.Length;
src\libraries\System.Private.CoreLib\src\System\Globalization\IdnMapping.cs (12)
498if (output.Length - iOutputAfterLastDot > c_labelLimit) 506iOutputAfterLastDot = output.Length; 510if (output.Length > c_defaultNameLimit - (IsDot(unicode[^1]) ? 0 : 1)) 707bias = Adapt(i - oldi, (output.Length - iOutputAfterLastDot - numSurrogatePairs) + 1, oldi == 0); 711Debug.Assert((output.Length - iOutputAfterLastDot - numSurrogatePairs) + 1 > 0, 713if (i / ((output.Length - iOutputAfterLastDot - numSurrogatePairs) + 1) > c_maxint - n) 715n += (int)(i / (output.Length - iOutputAfterLastDot - numSurrogatePairs + 1)); 716i %= (output.Length - iOutputAfterLastDot - numSurrogatePairs + 1); 734if (iUseInsertLocation >= output.Length) 769for (int iTest = iOutputAfterLastDot; iTest < output.Length; iTest++) 799iOutputAfterLastDot = output.Length; 803if (output.Length > c_defaultNameLimit - (IsDot(output[^1]) ? 0 : 1))
src\libraries\System.Private.CoreLib\src\System\IO\TextReader.cs (1)
190if (sb.Length > 0)
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\libraries\System.Private.CoreLib\src\System\Text\DecoderFallback.cs (1)
302if (strBytes.Length > 0)
src\libraries\System.Private.CoreLib\src\System\Text\StringBuilder.cs (45)
274if (value < Length) 317if (Length == 0) 322string result = string.FastAllocateString(Length); 358int currentLength = this.Length; 405int delta = value - Length; 417int capacityToPreserve = Math.Min(Capacity, Math.Max(Length * 6 / 5, m_ChunkChars.Length)); 441Debug.Assert(Length == value, "Something went wrong setting Length."); 687if ((uint)(repeatCount + Length) > (uint)m_MaxCapacity) 795if (value != null && value.Length != 0) 797return AppendCore(value, 0, value.Length); 821if (count > value.Length - startIndex) 836int newLength = Length + count; 888if ((uint)sourceIndex > (uint)Length) 893if (sourceIndex > Length - count) 939int currentLength = Length; 953if (insertingChars > MaxCapacity - this.Length) 957Debug.Assert(insertingChars + this.Length < int.MaxValue); 980if (length > Length - startIndex) 985if (Length == length && startIndex == 0) 1294if ((uint)index > (uint)Length) 1321if ((uint)index > (uint)Length) 1332if ((uint)index > (uint)Length) 1346int currentLength = Length; 1399if ((uint)index > (uint)Length) 1942public StringBuilder Replace(string oldValue, string? newValue) => Replace(oldValue, newValue, 0, Length); 1953public StringBuilder Replace(ReadOnlySpan<char> oldValue, ReadOnlySpan<char> newValue) => Replace(oldValue, newValue, 0, Length); 1965if (Length != sb.Length) 2025if (span.Length != Length) 2048Debug.Assert(offset == Length); 2082int currentLength = Length; 2199return Replace(oldChar, newChar, 0, Length); 2211int currentLength = Length; 2304int newLength = Length + valueCount; 2338Debug.Assert((uint)index <= (uint)Length, "Callers should check that index is a legal value."); 2506Debug.Assert(0 <= index && index <= Length); 2548Debug.Assert(Capacity == Length, nameof(ExpandByABlock) + " should only be called when there is no space left."); 2553if ((minBlockCharCount + Length) > m_MaxCapacity || minBlockCharCount + Length < minBlockCharCount) 2562int newBlockLength = Math.Max(minBlockCharCount, Math.Min(Length, MaxChunkSize)); 2642if (count + Length > m_MaxCapacity || count + Length < count) 2734Debug.Assert(startIndex >= 0 && startIndex < Length); 3012int start = _stringBuilder.Length; 3014int paddingRequired = -alignment - (_stringBuilder.Length - start);
src\System\StubHelpers.cs (1)
1032int pManagedHomeLength = pManagedHome.Length;
System.Private.DataContractSerialization (4)
System\Runtime\Serialization\Json\XmlObjectSerializerReadContextComplexJson.cs (1)
327if (stringBuilder.Length != 0)
System\Runtime\Serialization\XmlObjectSerializerReadContext.cs (1)
257if (stringBuilder.Length != 0)
System\Xml\XmlDictionaryReader.cs (2)
411if (sb.Length > maxStringContentLength - value.Length) 480if (sb.Length > maxStringContentLength - value.Length)
System.Private.Uri (1)
System\Uri.cs (1)
4948if (relPath.Length == 0 && path2.Length - 1 == si)
System.Private.Xml (66)
System\Xml\Core\XmlTextReaderImpl.cs (23)
2166Debug.Assert(_stringBuilder.Length == 0); 3609Debug.Assert(_stringBuilder.Length == 0 || isTextDecl); 3618int originalSbLen = sb.Length; 5103Debug.Assert(_stringBuilder.Length == 0); 5200int valueChunkLen = _stringBuilder.Length - valueChunkStartPos; 5227valueChunkStartPos = _stringBuilder.Length; 5244int valueChunkLen = _stringBuilder.Length - valueChunkStartPos; 5339valueChunkStartPos = _stringBuilder.Length; 5352int valueChunkLen = _stringBuilder.Length - valueChunkStartPos; 5402Debug.Assert(_stringBuilder.Length == 0); 5442Debug.Assert(_stringBuilder.Length > 0); 5483} while (!fullValue && orChars <= 0x20 && _stringBuilder.Length < MinWhitespaceLookahedCount); 5486XmlNodeType nodeType = (_stringBuilder.Length < MinWhitespaceLookahedCount) ? GetTextNodeType(orChars) : XmlNodeType.Text; 5771Debug.Assert(_stringBuilder.Length == 0); 5786Debug.Assert(_stringBuilder.Length > 0); 5900Debug.Assert(_stringBuilder.Length == 0); 5919if (_stringBuilder.Length > 0) 6203Debug.Assert(_stringBuilder.Length == 0); 6274Debug.Assert(_stringBuilder.Length == 0); 6477Debug.Assert(_stringBuilder.Length == 0); 8579Debug.Assert(_stringBuilder.Length == 0); 8633if (_stringBuilder.Length == 0) 8690if (_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)
877if (_textValue.Length > 0) 2634Debug.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)
1142if (anyNamespaces.Length > 0)
System\Xml\Serialization\ReflectionXmlSerializationWriter.cs (1)
923if (sb.Length != 0)
System\Xml\Serialization\Xmlcustomformatter.cs (2)
206if (sb.Length != 0) 217if (sb.Length == 0 && iZero >= 0)
System\Xml\Serialization\XmlSerializationWriter.cs (1)
1252if (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)
1021if (_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.Reflection.Emit (2)
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)
1417for (int i = 0; i < identifier.Length && builder.Length < MaxIdentifierLength; i++) 1428if (builder.Length == 0) 1539if (builder.Length == 0) 1542int length = builder.Length; 1543if (builder[builder.Length - 1] == '.') 1555int fragmentOffset = builder.Length; 1558for (int i = 0; i < fragment.Length && builder.Length < MaxIdentifierLength; i++) 1570else if ((c == '.' || c == '/' || c == ':') && (builder.Length == 1 1571|| (builder.Length > 1 && builder[builder.Length - 1] != '.'))) 1575fragmentOffset = builder.Length;
System.Security.Cryptography (3)
System\Security\Cryptography\X509Certificates\OpenSslDirectoryBasedStoreProvider.cs (1)
299int prefixLength = pathBuilder.Length;
System\Security\Cryptography\X509Certificates\OpenSslX509ChainProcessor.cs (2)
1581if (builder.Length > 0) 1589if (builder.Length == 0)
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.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)
189sb.Remove(sb.Length - 3, 1);
System.Text.Json (1)
System\Text\Json\ThrowHelper.Serialization.cs (1)
317if (listOfMissingPropertiesBuilder.Length >= CutOffLength)
System.Text.Json.SourceGeneration (1)
src\libraries\Common\src\SourceGenerators\SourceWriter.cs (1)
66Debug.Assert(_indentation == 0 && _sb.Length > 0);
System.Text.RegularExpressions (9)
System\Text\RegularExpressions\RegexCharClass.cs (4)
1654int categoriesLength = _categories?.Length ?? 0; 1754(_categories is null || _categories.Length == 0)) 1796_categories?.Length > 0 && 1812_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.Generator (11)
RegexGenerator.Emitter.cs (2)
727int additionalDeclarationsPosition = ((StringWriter)writer.InnerWriter).GetStringBuilder().Length; 1509int additionalDeclarationsPosition = ((StringWriter)writer.InnerWriter).GetStringBuilder().Length;
src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexCharClass.cs (4)
1654int categoriesLength = _categories?.Length ?? 0; 1754(_categories is null || _categories.Length == 0)) 1796_categories?.Length > 0 && 1812_categories?.Length > 0 &&
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.Web.Services.Description (1)
System\Web\Services\Description\ServiceDescriptionSerializer.cs (1)
3615if (sb.Length != 0) {
System.Windows.Forms (10)
System\Windows\Forms\Application.cs (1)
1289currentStartInfo.Arguments = sb.ToString(0, sb.Length - 1);
System\Windows\Forms\Controls\DataGridView\DataGridViewCell.cs (1)
1367int 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)
1747if (name.Length == 0) 1775if (name.Length == 0)
System.Windows.Input.Manipulations (3)
System\Windows\Input\Manipulations\InertiaProcessor2D.cs (1)
1096if (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)
Test.Utilities (1)
src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (1)
185if (currentXmlComment.Length > 0)
Text.Analyzers (1)
src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (1)
185if (currentXmlComment.Length > 0)
UnitTests.Common (2)
TestHelpers.cs (2)
109return errorBuilder.Length == 0 ? null : errorBuilder.ToString(); 217return errorBuilder.Length == 0 ? null : errorBuilder.ToString();
xunit.assert (1)
Sdk\CollectionTracker.cs (1)
635 pointerIndent = printedValues.Length;
xunit.console (2)
CommandLine.cs (2)
170if (sb.Length > 0 || shouldCreateNewArg) 193if (sb.Length > 0 || breakOn.HasValue || shouldCreateNewArg)