4986 references to Chars
Aspire.Dashboard (5)
Components\Controls\StructuredLogDetails.razor.cs (1)
143if (value[i] != '0')
Otlp\Model\OtlpUnits.cs (2)
41if (updatedUnit[i] == '/') 71var c = unit[i];
Otlp\Storage\ApplicationKey.cs (2)
23instanceId[name.Length] == '-') 70if (name[Name.Length] != '-')
Aspire.Hosting (18)
ApplicationModel\ModelName.cs (3)
54if (name[i] == '-') 63else if (!IsAsciiLetterOrDigit(name[i])) 80if (name[name.Length - 1] == '-')
ApplicationModel\ReferenceExpression.cs (3)
171var c = input[i]; 195idx + 1 < s.Length && s[idx + 1] == s[idx];
Dcp\DcpExecutor.cs (5)
463if ((applicationName[i] is >= 'a' and <= 'z') || 464(applicationName[i] is >= 'A' and <= 'Z') || 465(applicationName[i] is >= '0' and <= '9') || 466(applicationName[i] is '_' or '-' or '.')) 468normalizedName.Append(applicationName[i]);
src\Shared\CommandLineArgsParser.cs (6)
41while (i < arguments.Length && (arguments[i] == ' ' || arguments[i] == '\t')) 64while (i < arguments.Length && arguments[i] == '\\') 72if (i >= arguments.Length || arguments[i] != '"') 94char c = arguments[i]; 101if (inQuotes && i < arguments.Length - 1 && arguments[i + 1] == '"')
VolumeNameGenerator.cs (1)
57if (!IsValidChar(i, value[i]))
Aspire.Hosting.Analyzers (3)
src\Aspire.Hosting\ApplicationModel\ModelName.cs (3)
54if (name[i] == '-') 63else if (!IsAsciiLetterOrDigit(name[i])) 80if (name[name.Length - 1] == '-')
Aspire.Hosting.Azure (2)
Utils\ResourceGroupNameHelpers.cs (2)
26var c = resourceGroupName[i]; 46var c = normalizedString[i];
Aspire.Hosting.Azure.Functions (6)
src\Shared\CommandLineArgsParser.cs (6)
41while (i < arguments.Length && (arguments[i] == ' ' || arguments[i] == '\t')) 64while (i < arguments.Length && arguments[i] == '\\') 72if (i >= arguments.Length || arguments[i] != '"') 94char c = arguments[i]; 101if (inQuotes && i < arguments.Length - 1 && arguments[i + 1] == '"')
Aspire.Hosting.RabbitMQ (1)
RabbitMQBuilderExtensions.cs (1)
244var c = tag[i];
BuildBoss (1)
TargetsCheckerUtil.cs (1)
119value[value.Length - 1] == ')';
ClientSample (3)
src\Shared\CommandLineUtils\CommandLine\AnsiConsole.cs (3)
78message[endIndex] >= 0x20 && 79message[endIndex] <= 0x3f) 91switch (message[endIndex])
CodeGenerator (1)
src\Servers\Kestrel\shared\KnownHeaders.cs (1)
515var ch = (byte)name[offset + count - scan - 1];
Crossgen2Tasks (1)
CommonFilePulledFromSdkRepo\NuGetUtils.NuGet.cs (1)
31char separator = path[path.Length - 4];
dotnet-dev-certs (3)
src\Shared\CommandLineUtils\CommandLine\AnsiConsole.cs (3)
78message[endIndex] >= 0x20 && 79message[endIndex] <= 0x3f) 91switch (message[endIndex])
dotnet-getdocument (3)
src\Shared\CommandLineUtils\CommandLine\AnsiConsole.cs (3)
78message[endIndex] >= 0x20 && 79message[endIndex] <= 0x3f) 91switch (message[endIndex])
dotnet-openapi (3)
src\Shared\CommandLineUtils\CommandLine\AnsiConsole.cs (3)
78message[endIndex] >= 0x20 && 79message[endIndex] <= 0x3f) 91switch (message[endIndex])
dotnet-sql-cache (3)
src\Shared\CommandLineUtils\CommandLine\AnsiConsole.cs (3)
78message[endIndex] >= 0x20 && 79message[endIndex] <= 0x3f) 91switch (message[endIndex])
dotnet-svcutil.xmlserializer (6)
Microsoft\Tools\ServiceModel\SvcUtil\Options.cs (1)
231string invalidCharacter = value[invalidCharacterIndex].ToString();
Microsoft\Tools\ServiceModel\SvcUtil\ToolConsole.cs (5)
526while ((index < text.Length) && char.IsWhiteSpace(text[index])) 551_stringBuilder.Append(text[index]); 591if (char.IsWhiteSpace(text[end])) 606if (Environment.NewLine[i] != text[index + i])
dotnet-svcutil-lib (374)
FrameworkFork\Microsoft.CodeDom\Compiler\CodeGenerator.cs (1)
2218char ch = value[i];
FrameworkFork\Microsoft.CodeDom\Compiler\CodeValidator.cs (4)
684if (baseType[i] == '`') 688while (i < baseType.Length && baseType[i] >= '0' && baseType[i] <= '9') 690numTypeArgs = numTypeArgs * 10 + (baseType[i] - '0');
FrameworkFork\Microsoft.CodeDom\Microsoft\CSharpCodeProvider.cs (21)
450switch (value[i]) 475AppendEscapedChar(b, value[i]); 479b.Append(value[i]); 491if (Char.IsHighSurrogate(value[i]) 493&& Char.IsLowSurrogate(value[i + 1])) 519if (value[i] == '\"') 522b.Append(value[i]); 1550if (value[i] == '\u0000') 1554Output.Write(value[i]); 1556if (value[i] == '\r') 1558if (i < value.Length - 1 && value[i + 1] == '\n') 1566else if (value[i] == '\n') 1571else if (value[i] == '\u2028' || value[i] == '\u2029' || value[i] == '\u0085') 3748switch (baseType[i]) 3762while (i < baseType.Length && baseType[i] >= '0' && baseType[i] <= '9') 3764numTypeArgs = numTypeArgs * 10 + (baseType[i] - '0'); 3773if (i < baseType.Length && (baseType[i] == '+' || baseType[i] == '.'))
FrameworkFork\Microsoft.CodeDom\System\CodeTypeReference.cs (13)
165if (typeName[current--] == ']') 167while (current >= 0 && typeName[current] == ',') 173if (current >= 0 && typeName[current] == '[') 188if (current > 0 && typeName[current--] == ']') 197if (typeName[current] == '[') 202else if (typeName[current] == ']') 206else if (typeName[current] == ',' && unmatchedRightBrackets == 1) 440while (start < typeName.Length && Char.IsWhiteSpace(typeName[start])) start++; 441while (end >= 0 && Char.IsWhiteSpace(typeName[end])) end--; 445if (typeName[start] == '[' && typeName[end] == ']') 452if (typeName[end] != ']') 457if (typeName[index] == ',')
FrameworkFork\Microsoft.CodeDom\System\FixedStringLookup.cs (2)
74searchChar = char.ToLowerInvariant(value[pos]); 78searchChar = value[pos];
FrameworkFork\Microsoft.Xml\Xml\Base64Decoder.cs (1)
152mapBase64[(int)s_charsBase64[i]] = (byte)i;
FrameworkFork\Microsoft.Xml\Xml\BinHexEncoder.cs (2)
79outArray[curOffsetOut++] = s_hexDigits[b >> 4]; 84outArray[curOffsetOut++] = s_hexDigits[b & 0xF];
FrameworkFork\Microsoft.Xml\Xml\Cache\XPathNodeInfoAtom.cs (1)
143_localNameHash += (_localNameHash << 7) ^ _localName[i];
FrameworkFork\Microsoft.Xml\Xml\Core\CharEntityEncoderFallback.cs (1)
166char ch = _charEntity[_charEntityIndex++];
FrameworkFork\Microsoft.Xml\Xml\Core\ReadOnlyTernaryTree.cs (2)
63charToFind = stringToFind[stringPos]; 108charToFind = stringToFind[stringPos];
FrameworkFork\Microsoft.Xml\Xml\Core\SecureStringHasher.cs (1)
76hashCode += (hashCode << 7) ^ key[i];
FrameworkFork\Microsoft.Xml\Xml\Core\util\TernaryTreeGenerator.cs (2)
224charToAdd = stringToAdd[stringPos]; 280charToAdd = stringToAdd[i];
FrameworkFork\Microsoft.Xml\Xml\Core\XmlCharCheckingWriter.cs (6)
406if ((ch = str[i]) >= 0x20) 424if (i + 1 < str.Length && str[i + 1] == '\n') 559if (text[i] != invChar2) 563if (i > 0 && text[i - 1] == invChar1) 578return (i == 0 || text[i - 1] != invChar1) ? text : (text + ' '); 583if (i > 0 && text[i - 1] == invChar1)
FrameworkFork\Microsoft.Xml\Xml\Core\XmlEncodedRawTextWriter.cs (6)
1741if (!xmlCharType.IsTextChar(chars[i])) 1743switch (chars[i]) 1755if (XmlCharType.IsHighSurrogate(chars[i])) 1759if (XmlCharType.IsLowSurrogate(chars[i + 1])) 1768else if (XmlCharType.IsLowSurrogate(chars[i])) 1770error = string.Format(ResXml.Xml_InvalidSurrogateHighChar, ((uint)chars[i]).ToString("X", CultureInfo.InvariantCulture));
FrameworkFork\Microsoft.Xml\Xml\Core\XmlTextEncoder.cs (5)
286while (i < len && (_xmlCharType.charProperties[ch = text[i]] & XmlCharType.fAttrValue) != 0) 383throw XmlConvert.CreateInvalidSurrogatePairException(text[i], ch); 401while (i < len && (_xmlCharType.charProperties[ch = text[i]] & XmlCharType.fAttrValue) != 0) 432((_xmlCharType.charProperties[ch = text[i]] & XmlCharType.fCharData) != 0 // ( xmlCharType.IsCharData( ( ch = text[i] ) ) 446char lowChar = text[i + 1];
FrameworkFork\Microsoft.Xml\Xml\Core\XmlTextReaderImpl.cs (3)
9754while (value[startPos] == 0x20) 9766if (value[i] == 0x20) 9769while (j < len && value[j] == 0x20)
FrameworkFork\Microsoft.Xml\Xml\Core\XmlTextWriter.cs (2)
729if (null != text && (text.IndexOf("--", StringComparison.Ordinal) >= 0 || (text.Length != 0 && text[text.Length - 1] == '-'))) 1649if (name[position] == ':')
FrameworkFork\Microsoft.Xml\Xml\Core\XmlUtf8RawTextWriter.cs (6)
1621if (!xmlCharType.IsTextChar(chars[i])) 1623switch (chars[i]) 1635if (XmlCharType.IsHighSurrogate(chars[i])) 1639if (XmlCharType.IsLowSurrogate(chars[i + 1])) 1648else if (XmlCharType.IsLowSurrogate(chars[i])) 1650error = string.Format(ResXml.Xml_InvalidSurrogateHighChar, ((uint)chars[i]).ToString("X", CultureInfo.InvariantCulture));
FrameworkFork\Microsoft.Xml\Xml\Core\XmlWellformedWriter.cs (1)
2167if ((_xmlCharType.charProperties[ncname[i]] & XmlCharType.fNCNameSC) != 0)
FrameworkFork\Microsoft.Xml\Xml\Dom\XmlName.cs (1)
189char ch = name[i];
FrameworkFork\Microsoft.Xml\Xml\NameTable.cs (3)
82hashCode += (hashCode << 7) ^ key[i]; 153hashCode += (hashCode << 7) ^ value[i]; 253if (str1[i] != str2[str2Start + i])
FrameworkFork\Microsoft.Xml\Xml\schema\DtdParser.cs (3)
3633while (value[startPos] == 0x20) 3645if (value[i] == 0x20) 3648while (j < len && value[j] == 0x20)
FrameworkFork\Microsoft.Xml\Xml\schema\Inference\infer.cs (110)
1773switch (s[i]) 1805switch (s[i]) 1811if (s[i] >= '0' && s[i] <= '9') 1818switch (s[i]) 1824if (s[i] >= '0' && s[i] <= '9') 1831switch (s[i]) 1837if (s[i] >= '0' && s[i] <= '9') 1844if (s[i] >= '0' && s[i] <= '9') 1850if (s[i] >= '0' && s[i] <= '9') //".9999e+9 1857switch (s[i]) 1866if (s[i] >= '0' && s[i] <= '9') //-9 1873switch (s[i]) 1880if (s[i] >= '0' && s[i] <= '9') //"+9 1887switch (s[i]) 1892if (s[i] >= '0' && s[i] <= '9') //"P9" 1898switch (s[i]) 1907if (s[i] >= '0' && s[i] <= '9') 1919switch (s[i]) 1924if (s[i] >= '0' && s[i] <= '9') 1931switch (s[i]) 1938if (s[i] >= '0' && s[i] <= '9') 1950switch (s[i]) 1955if (s[i] >= '0' && s[i] <= '9') 1962switch (s[i]) 1967if (s[i] >= '0' && s[i] <= '9') 1979switch (s[i]) 1988if (s[i] >= '0' && s[i] <= '9') 1994switch (s[i]) 2005if (s[i] >= '0' && s[i] <= '9') 2017if (s[i] >= '0' && s[i] <= '9') 2023switch (s[i]) 2032if (s[i] >= '0' && s[i] <= '9') 2044if (s[i] >= '0' && s[i] <= '9') 2050switch (s[i]) 2057if (s[i] >= '0' && s[i] <= '9') 2069if (s[i] >= '0' && s[i] <= '9') 2075switch (s[i]) 2080if (s[i] >= '0' && s[i] <= '9') 2120switch (s[i]) 2129if (s[i] >= '0' && s[i] <= '9') 2145switch (s[i]) 2157if (s[i] >= '0' && s[i] <= '9') 2174switch (s[i]) 2183if (s[i] >= '0' && s[i] <= '9') 2200switch (s[i]) 2212if (s[i] >= '0' && s[i] <= '9') 2219if (s[i] < '0' || s[i] > '9') 2222if (s[i] < '0' || s[i] > '9') 2230switch (s[i]) 2246if (s[i] < '0' || s[i] > '9') 2249if (s[i] < '0' || s[i] > '9') 2252switch (s[i]) 2287if (s[i] < '0' || s[i] > '9') 2290if (s[i] < '0' || s[i] > '9') 2293if (s[i] != ':') 2297if (s[i] < '0' || s[i] > '9') 2300if (s[i] < '0' || s[i] > '9') 2318if (s[i] < '0' || s[i] > '9') 2321if (s[i] < '0' || s[i] > '9') 2324if (s[i] != ':') 2328if (s[i] < '0' || s[i] > '9') 2331if (s[i] < '0' || s[i] > '9') 2334if (s[i] != ':') 2337if (s[i] < '0' || s[i] > '9') 2340if (s[i] < '0' || s[i] > '9') 2343switch (s[i]) 2358if (s[i] < '0' || s[i] > '9') 2362switch (s[i]) 2371if (s[i] >= '0' && s[i] <= '9')
FrameworkFork\Microsoft.Xml\Xml\schema\XsdDateTime.cs (11)
746while (start < _length && char.IsWhiteSpace(text[start])) 961int d = _text[start] - '0'; 1015char ch = _text[start]; 1042while (start < _length && char.IsWhiteSpace(_text[start])) 1054int d4 = _text[start] - '0'; 1055int d3 = _text[start + 1] - '0'; 1056int d2 = _text[start + 2] - '0'; 1057int d1 = _text[start + 3] - '0'; 1075int d2 = _text[start] - '0'; 1076int d1 = _text[start + 1] - '0'; 1090return start < _length && _text[start] == ch;
FrameworkFork\Microsoft.Xml\Xml\schema\XsdDuration.cs (16)
516if (s[pos] == '-') 528if (s[pos++] != 'P') goto InvalidFormat; 535if (s[pos] == 'Y') 549if (s[pos] == 'M') 563if (s[pos] == 'D') 577if (s[pos] == 'T') 587if (s[pos] == 'H') 601if (s[pos] == 'M') 615if (s[pos] == '.') 640if (s[pos] != 'S') goto InvalidFormat; 643else if (s[pos] == 'S') 696while (offset < offsetEnd && s[offset] >= '0' && s[offset] <= '9') 698digit = s[offset] - '0'; 710while (offset < offsetEnd && s[offset] >= '0' && s[offset] <= '9')
FrameworkFork\Microsoft.Xml\Xml\Serialization\CodeIdentifier.cs (1)
72char c = identifier[i];
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlSerializationWriter.cs (2)
4392writer.Write(hexDigits[b >> 4]); 4393writer.Write(hexDigits[b & 0xF]);
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlSerializationWriterILGen.cs (2)
2709writer.Append(hexDigits[b >> 4]); 2710writer.Append(hexDigits[b & 0xF]);
FrameworkFork\Microsoft.Xml\Xml\ValidateNames.cs (16)
48if ((s_xmlCharType.charProperties[s[i]] & XmlCharType.fNCNameSC) != 0) 84if ((s_xmlCharType.charProperties[s[i]] & XmlCharType.fNCNameSC) != 0 || s[i] == ':') 127if ((s_xmlCharType.charProperties[s[i]] & XmlCharType.fNCStartNameSC) != 0 || s[i] == ':') 144if ((s_xmlCharType.charProperties[s[i]] & XmlCharType.fNCNameSC) != 0 || s[i] == ':') 187if ((s_xmlCharType.charProperties[s[i]] & XmlCharType.fNCStartNameSC) != 0) 204if ((s_xmlCharType.charProperties[s[i]] & XmlCharType.fNCNameSC) != 0) 280if (offset < s.Length && s[offset] == ':') 347if (len < s.Length && s[len] == ':') 352if (offset < s.Length && s[offset] == '*') 402if (s_xmlCharType.IsNCNameSingleChar(s[offsetBadChar]) && !XmlCharType.Instance.IsStartNCNameSingleChar(s[offsetBadChar])) 422if (s_xmlCharType.IsNCNameSingleChar(s[offsetBadChar]) && !s_xmlCharType.IsStartNCNameSingleChar(s[offsetBadChar]))
FrameworkFork\Microsoft.Xml\Xml\XmlCharType.cs (9)
458for (int i = ranges[p], last = ranges[p + 1]; i <= last; i++) 568return (s_PublicIdBitmap[ch >> 4] & (1 << (ch & 0xF))) != 0; 671if ((charProperties[str[i]] & fWhitespace) == 0) 686if ((charProperties[str[i]] & fCharData) == 0) 688if (i + 1 >= str.Length || !(XmlCharType.IsHighSurrogate(str[i]) && XmlCharType.IsLowSurrogate(str[i + 1]))) 710if (!IsDigit(str[i])) 740if (!IsPubidChar(str[i]))
FrameworkFork\Microsoft.Xml\Xml\XmlComplianceUtil.cs (6)
30while (xmlCharType.IsWhiteSpace(value[startPos])) 42if (!xmlCharType.IsWhiteSpace(value[i])) 49while (j < len && xmlCharType.IsWhiteSpace(value[j])) 65if (j > i + 1 || value[i] != 0x20) 119char ch = value[i]; 136if (ch == 0xD && (i + 1 < len && value[i + 1] == 0xA))
FrameworkFork\Microsoft.Xml\Xml\XmlConvert.cs (29)
135if (name[position + 6] != '_') 138FromHex(name[position + 2]) * 0x10000000 + 139FromHex(name[position + 3]) * 0x1000000 + 140FromHex(name[position + 4]) * 0x100000 + 141FromHex(name[position + 5]) * 0x10000 + 143FromHex(name[position + 6]) * 0x1000 + 144FromHex(name[position + 7]) * 0x100 + 145FromHex(name[position + 8]) * 0x10 + 146FromHex(name[position + 9]); 171FromHex(name[position + 2]) * 0x1000 + 172FromHex(name[position + 3]) * 0x100 + 173FromHex(name[position + 4]) * 0x10 + 174FromHex(name[position + 5]))); 262if ((local && !s_xmlCharType.IsNCNameCharXml4e(name[position])) || 263(!local && !s_xmlCharType.IsNameCharXml4e(name[position])) || 279if ((length > position + 1) && XmlCharType.IsHighSurrogate(name[position]) && XmlCharType.IsLowSurrogate(name[position + 1])) 281int x = name[position]; 282int y = name[position + 1]; 290bufBld.Append(((Int32)name[position]).ToString("X4", CultureInfo.InvariantCulture)); 468if (token[0] == ' ' || token[token.Length - 1] == ' ' || token.IndexOfAny(crt) != -1 || token.IndexOf(" ", StringComparison.Ordinal) != -1) 481if (token[0] == ' ' || token[token.Length - 1] == ' ' || token.IndexOfAny(crt) != -1 || token.IndexOf(" ", StringComparison.Ordinal) != -1) 1563while (i < strLen1 && chars[strPos1 + i] == str2[i]) 1634while (i < len && (s_xmlCharType.charProperties[data[i]] & XmlCharType.fCharData) != 0) 1643char ch = data[i]; 1650ch = data[i + 1]; 1658throw CreateInvalidSurrogatePairException(data[i + 1], data[i], invSurrogateExceptionType, 0, i + 1); 1714char ch = value[i];
FrameworkFork\Microsoft.Xml\Xml\XmlException.cs (2)
190return BuildCharExceptionArgs(data[invCharIndex], invCharIndex + 1 < data.Length ? data[invCharIndex + 1] : '\0');
FrameworkFork\Microsoft.Xml\Xml\XPath\Internal\BooleanFunctions.cs (1)
85(lang.Length == str.Length || lang[str.Length] == '-')
FrameworkFork\Microsoft.Xml\Xml\XPath\Internal\StringFunctions.cs (5)
232if (!xmlCharType.IsWhiteSpace(str1[count])) 235str2.Append(str1[count]); 255index = str2.IndexOf(str1[count]); 260str.Append(str3[index]); 265str.Append(str1[count]);
FrameworkFork\Microsoft.Xml\Xml\XPath\Internal\XPathScanner.cs (2)
48_currentChar = _xpathExpr[_xpathExprIndex++]; 310Debug.Assert(0 <= start && _xpathExpr[start] == '.');
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\CodeExporter.cs (2)
1335char c = identifier[i]; 1468char c = fragment[i];
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\DataContract.cs (4)
1362char ch = localName[i]; 2013char ch = format[i]; 2019if (format[i] == '}') 2023if (format[start] == '#' && i == (start + 1))
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\EnumDataContract.cs (3)
389if (stringValue[i] != ' ') 397if (stringValue[i] == ' ') 403if (stringValue[i] != ' ')
FrameworkFork\System.Runtime.Serialization\System\Xml\ValueHandle.cs (3)
555DiagnosticUtility.DebugAssert(str[i] < 128, ""); 557if (ch == str[i]) 560if (checkLower && char.ToLowerInvariant((char)ch) == str[i])
FrameworkFork\System.Runtime.Serialization\System\Xml\XmlBaseWriter.cs (3)
417else if (text.IndexOf("--", StringComparison.Ordinal) != -1 || (text.Length > 0 && text[text.Length - 1] == '-')) 706if (!IsWhitespace(s[i])) 935char c = whitespace[i];
FrameworkFork\System.Runtime.Serialization\System\Xml\XmlBufferReader.cs (2)
862if (!XmlConverter.IsWhitespace(s[i])) 977if (s2[i] != (char)b)
FrameworkFork\System.Runtime.Serialization\System\Xml\XmlConverter.cs (7)
828Fx.Assert(s[i] < 128, ""); 829buffer[offset++] = (byte)s[i]; 1131if (!IsWhitespace(s[i])) 1147if (IsWhitespace(s[i])) 1158char ch = s[i]; 1170for (i = 0; i < s.Length && IsWhitespace(s[i]); i++) 1173for (j = s.Length; j > 0 && IsWhitespace(s[j - 1]); j--)
FrameworkFork\System.ServiceModel\Internals\System\Runtime\Diagnostics\DiagnosticTraceBase.cs (1)
109char ch = text[i];
FrameworkFork\System.ServiceModel\Internals\System\Runtime\UrlUtility.cs (11)
107char ch = s[i]; 299char ch = s[pos]; 307if (s[pos + 1] == 'u' && pos < count - 5) 309int h1 = HexToInt(s[pos + 2]); 310int h2 = HexToInt(s[pos + 3]); 311int h3 = HexToInt(s[pos + 4]); 312int h4 = HexToInt(s[pos + 5]); 326int h1 = HexToInt(s[pos + 1]); 327int h2 = HexToInt(s[pos + 2]); 511char ch = s[i]; 556if (i == l - 1 && s[i] == '&')
FrameworkFork\System.ServiceModel\System\IdentityModel\CanonicalFormWriter.cs (1)
28char c = s[i];
FrameworkFork\System.ServiceModel\System\IdentityModel\Claims\X509CertificateClaimSet.cs (2)
455s_delimiter = x509ExtensionFormattedString[delimiterIndex]; 467if (x509ExtensionFormattedString[i] == s_identifier[0])
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\Addressing.cs (1)
94if (act.Length > 0 && (act[0] <= 32 || act[act.Length - 1] <= 32))
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\MessageEncoder.cs (5)
151contentType[supportedContentType.Length] == ';') 163char ch = contentType[supportedContentType.Length]; 174if (ch == '\r' && contentType.Length > supportedContentType.Length + 1 && contentType[i + 1] == '\n') 177ch = contentType[i]; 186ch = contentType[i];
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\TextMessageEncoder.cs (7)
143&& contentType[semiColonIndex + 2] == 'c' 157if (contentType[i] == ';') 163if (contentType[i] == '\n') 165if (i == semiColonIndex || contentType[i - 1] != '\r') 174if (contentType[i] != ' ' 175&& contentType[i] != '\t') 201if (charSet.Length > 2 && charSet[0] == '"' && charSet[charSet.Length - 1] == '"')
FrameworkFork\System.ServiceModel\System\ServiceModel\Description\ServiceReflector.cs (1)
202char ch = localName[i];
FrameworkFork\System.ServiceModel\System\ServiceModel\Description\UniqueCodeIdentifierScope.cs (1)
99char c = identifier[i];
FrameworkFork\System.ServiceModel\System\ServiceModel\EndpointAddress.cs (3)
385int u1Len = (u1Path.Length > 0 && u1Path[u1Path.Length - 1] == '/') ? u1Path.Length - 1 : u1Path.Length; 386int u2Len = (u2Path.Length > 0 && u2Path[u2Path.Length - 1] == '/') ? u2Path.Length - 1 : u2Path.Length; 415if (uriString.Length > 0 && uriString[uriString.Length - 1] != '/')
FrameworkFork\System.ServiceModel\System\ServiceModel\Security\XmlHelper.cs (2)
318char c = idPrefix[i]; 321throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("idPrefix", string.Format(SRServiceModel.InValidateId, idPrefix[i])));
FrameworkFork\System.ServiceModel\System\ServiceModel\XmlUtil.cs (4)
58for (i = s.Length; i > 0 && IsWhitespace(s[i - 1]); i--) ; 71for (i = 0; i < s.Length && IsWhitespace(s[i]); i++) ; 84for (i = 0; i < s.Length && IsWhitespace(s[i]); i++) ; 92for (j = s.Length; j > 0 && IsWhitespace(s[j - 1]); j--) ;
HelpGenerator.cs (5)
348while ((index < text.Length) && char.IsWhiteSpace(text[index])) 373_stringBuilder.Append(text[index]); 413if (char.IsWhiteSpace(text[end])) 428if (Environment.NewLine[i] != text[index + i])
Metadata\HttpAuthenticationHelper.cs (5)
120if (originalString[index] == '"') 125if (originalString[index] == '\\' && index + 1 < originalString.Length) 129quoteString.Append(originalString[index]); 156if (challenge[i] == ',') 160else if (challenge[i] == '"')
Shared\FrameworkInfo.cs (1)
47char c = fullFrameworkName[i];
Shared\ProjectDependency.cs (1)
204if (assemblyName[assemblyName.Length - 1] == ',')
dotnet-user-jwts (3)
src\Shared\CommandLineUtils\CommandLine\AnsiConsole.cs (3)
78message[endIndex] >= 0x20 && 79message[endIndex] <= 0x3f) 91switch (message[endIndex])
dotnet-user-secrets (3)
src\Shared\CommandLineUtils\CommandLine\AnsiConsole.cs (3)
78message[endIndex] >= 0x20 && 79message[endIndex] <= 0x3f) 91switch (message[endIndex])
GenerateDocumentationAndConfigFiles (112)
JsonWriter.cs (1)
181char c = value[i];
src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (12)
53while (lastSeparator > 0 && IsDirectorySeparator(s[lastSeparator - 1])) 71if (s.Length == 0 || IsAnyDirectorySeparator(s[s.Length - 1])) 145if (IsDirectorySeparator(path[i])) 147if (i > 0 && IsDirectorySeparator(path[i - 1])) 240if (!IsDirectorySeparator(path[i])) 276while (i < length && IsDirectorySeparator(path[i])) 440char c = root[root.Length - 1]; 479if (path.Length > 0 && IsDirectorySeparator(path[path.Length - 1])) 611&& (IsDirectorySeparator(parentPath[parentPath.Length - 1]) || IsDirectorySeparator(childPath[parentPath.Length])); 663if (!PathCharEqual(path1[i], path2[i]))
src\Compilers\Core\Portable\InternalUtilities\FileNameUtilities.cs (2)
122if (path.Length > 0 && path[path.Length - 1] == '.') 175char ch = path[i];
src\Compilers\Core\Portable\InternalUtilities\StringExtensions.cs (7)
173char c = str[i++]; 178if (i < str.Length && char.IsLowSurrogate(str[i])) 208if (arg.Length > 1 && arg[0] == '"' && arg[arg.Length - 1] == '"') 224char.ToUpper(string1[x]) == char.ToUpper(string2[x])) 236string1[x] == string2[x])
src\Compilers\Core\Portable\InternalUtilities\StringTable.cs (3)
489if (array[i] != text[start + i]) 545if (ascii[i] != text[i])
src\Compilers\Core\Portable\InternalUtilities\UnicodeCharacterUtilities.cs (1)
106if (!IsIdentifierPartCharacter(name[i]))
src\Compilers\Core\Portable\Syntax\SyntaxTreeExtensions.cs (4)
65found = fromNode[index]; 66expected = fromText[index]; 100if (s1[i] != s2[i])
src\RoslynAnalyzers\Utilities\Compiler\Options\AnalyzerOptionsExtensions.cs (1)
365if (trimmedSuffix[i] != ' ')
src\RoslynAnalyzers\Utilities\Compiler\WellKnownTypeProvider.cs (2)
222if (fullTypeName[i] == '.') 227else if (!IsIdentifierPartCharacter(fullTypeName[i]))
src\RoslynAnalyzers\Utilities\Compiler\WordParser.cs (2)
558char c = _text[_index++]; 576char c = _text[index];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher.Lexer.cs (6)
26if (headerText[Position] == '\\') 80switch (headerText[position]) 86headerText[position] == '*') 124public readonly char CurrentCharacter => headerText[Position]; 126public char EatCurrentCharacter() => headerText[Position++]; 142public readonly char this[int position] => headerText[position];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\AbstractVirtualCharService.cs (6)
33var ch = tokenText[index]; 34var next = tokenText[index + 1]; 165if (tokenText[index] == '"' && tokenText[index + 1] == '"') 171else if (escapeBraces && IsOpenOrCloseBrace(tokenText[index])) 176result.Add(VirtualChar.Create(new Rune(tokenText[index]), span));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\AbstractVirtualCharService.ITextInfo.cs (1)
29public readonly char Get(string text, int index) => text[index];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\VirtualCharSequence.Chunks.cs (3)
102if (char.IsHighSurrogate(data[index])) 105!char.IsLowSurrogate(data[index + 1])); 110var ch = data[index];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\StringExtensions.cs (8)
20if (!char.IsWhiteSpace(line[i])) 35if (!char.IsWhiteSpace(line[i])) 87if (textSnippet[i] == '\t') 109if (predicate(text[i])) 158if (text[i] == '\n') 162else if (text[i] == '\r') 164if (i + 1 == text.Length || text[i + 1] != '\n') 230if (line[i] == '\t')
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\FormattingExtensions.cs (3)
228if (text[i] is not ' ' and not '\t') 245if (i >= newText.Length || text[i] != newText[i])
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\TriviaEngine\AbstractTriviaFormatter.cs (5)
147if (!IsWhitespace(text[i]) || !IsNewLine(text[i])) 503if (!char.IsWhiteSpace(this.OriginalString[i])) 533if (!IsWhitespace(this.OriginalString[i])) 743if (this.OriginalString[i] == '\n')
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.cs (11)
180private static readonly Func<string, TextSpan, bool> s_firstCharIsLowerCase = (val, span) => !DoesCharacterHaveCasing(val[span.Start]) || char.IsLower(val[span.Start]); 181private static readonly Func<string, TextSpan, bool> s_firstCharIsUpperCase = (val, span) => !DoesCharacterHaveCasing(val[span.Start]) || char.IsUpper(val[span.Start]); 187if (DoesCharacterHaveCasing(val[i]) && !char.IsUpper(val[i])) 200if (DoesCharacterHaveCasing(val[i]) && !char.IsLower(val[i])) 348switch (char.ToLowerInvariant(name[index])) 353if (index + 2 < name.Length && name[index + 1] == '_') 362if (index + 1 < name.Length && !char.IsDigit(name[index + 1]))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\ISyntaxFactsExtensions.cs (1)
263if (!syntaxFacts.IsIdentifierPartCharacter(name[i]))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (16)
65Debug.Assert(Data[Position] == c); 87Debug.Assert(char.IsNumber(Data[Position])); 92while (char.IsNumber(Data[Position])) 94var digit = Data[Position] - '0'; 139if ((SymbolKeyType)Data[Position] == SymbolKeyType.Null) 152if (Data[Position] != DoubleQuoteChar) 160if (Data[Position + 1] == DoubleQuoteChar) 202Debug.Assert((SymbolKeyType)Data[Position] != SymbolKeyType.Null); 261var ch = Data[Position]; 266var type = (SymbolKeyType)Data[Position]; 272else if (Data[Position] == DoubleQuoteChar) 306_builder.Append(Data[i]); 474var type = (SymbolKeyType)Data[Position]; 485type = (SymbolKeyType)Data[Position]; 547Debug.Assert((SymbolKeyType)Data[Position] != SymbolKeyType.Null); 646if ((SymbolKeyType)Data[Position] == SymbolKeyType.Null)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\Base64Utilities.cs (1)
338while (index >= 0 && attributeData[index] == '=')
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BKTree.cs (1)
79lowerCaseCharacters[i] = CaseInsensitiveComparison.ToLower(value[i]);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EditDistance.cs (2)
62array[i] = CaseInsensitiveComparison.ToLower(text[i]); 94targetLowerCaseCharacters[i] = CaseInsensitiveComparison.ToLower(target[i]);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\StringBreaker.cs (9)
46var firstChar = identifier[wordStart]; 86var c = identifier[current]; 108var c = identifier[current]; 118while (current < length && char.IsUpper(identifier[current])) 123if (current < length && IsLower(identifier[current])) 126Debug.Assert(char.IsUpper(identifier[current - 1])); 153while (current < length && IsLower(identifier[current])) 164while (current < length && char.IsDigit(identifier[current])) 176var ch = identifier[wordStart];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\StringEscapeEncoder.cs (2)
46builder.AppendFormat("{0:X2}", (int)text[index]); 105var ch = text[i];
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (1)
373if (p.Length > 0 && char.IsLetter(name[p.Start]))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\TypeInferenceService\AbstractTypeInferenceService.cs (1)
72var nextChar = name[prefix.Length];
GetDocument.Insider (3)
src\Shared\CommandLineUtils\CommandLine\AnsiConsole.cs (3)
78message[endIndex] >= 0x20 && 79message[endIndex] <= 0x3f) 91switch (message[endIndex])
HttpStress (1)
Program.cs (1)
432await context.Response.WriteAsync(contentSource[i].ToString());
illink (8)
ILLink.RoslynAnalyzer (4)
src\tools\illink\src\ILLink.Shared\DataFlow\CompilerGeneratedNames.cs (4)
34return typeName.Length > i + 1 && typeName[i + 1] == 'd'; 47return fieldName.Length > i + 1 && fieldName[i + 1] == '2'; 68return methodName.Length > i + 1 && methodName[i + 1] == 'b'; 86return methodName.Length > i + 1 && methodName[i + 1] == 'g';
InMemory.FunctionalTests (1)
src\Servers\Kestrel\shared\test\StreamBackedTestConnection.cs (1)
83var ch = text[index];
InteractiveHost.UnitTests (1)
SynchronizedTextWriter.cs (1)
57while (j < mark.Length && builder[i + j] == mark[j])
Interop.FunctionalTests (2)
H2SpecCommands.cs (2)
180if (line[firstSpace - 1] == '.') 203if (line[firstSpace - 1] == ':')
Metrics (110)
src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (12)
53while (lastSeparator > 0 && IsDirectorySeparator(s[lastSeparator - 1])) 71if (s.Length == 0 || IsAnyDirectorySeparator(s[s.Length - 1])) 145if (IsDirectorySeparator(path[i])) 147if (i > 0 && IsDirectorySeparator(path[i - 1])) 240if (!IsDirectorySeparator(path[i])) 276while (i < length && IsDirectorySeparator(path[i])) 440char c = root[root.Length - 1]; 479if (path.Length > 0 && IsDirectorySeparator(path[path.Length - 1])) 611&& (IsDirectorySeparator(parentPath[parentPath.Length - 1]) || IsDirectorySeparator(childPath[parentPath.Length])); 663if (!PathCharEqual(path1[i], path2[i]))
src\Compilers\Core\Portable\InternalUtilities\FileNameUtilities.cs (2)
122if (path.Length > 0 && path[path.Length - 1] == '.') 175char ch = path[i];
src\Compilers\Core\Portable\InternalUtilities\StringExtensions.cs (7)
173char c = str[i++]; 178if (i < str.Length && char.IsLowSurrogate(str[i])) 208if (arg.Length > 1 && arg[0] == '"' && arg[arg.Length - 1] == '"') 224char.ToUpper(string1[x]) == char.ToUpper(string2[x])) 236string1[x] == string2[x])
src\Compilers\Core\Portable\InternalUtilities\StringTable.cs (4)
489if (array[i] != text[start + i]) 519if (array[i] != text[i]) 545if (ascii[i] != text[i])
src\Compilers\Core\Portable\InternalUtilities\UnicodeCharacterUtilities.cs (1)
106if (!IsIdentifierPartCharacter(name[i]))
src\Compilers\Core\Portable\Syntax\SyntaxTreeExtensions.cs (4)
65found = fromNode[index]; 66expected = fromText[index]; 100if (s1[i] != s2[i])
src\RoslynAnalyzers\Utilities\Compiler\Options\AnalyzerOptionsExtensions.cs (1)
365if (trimmedSuffix[i] != ' ')
src\RoslynAnalyzers\Utilities\Compiler\WellKnownTypeProvider.cs (2)
222if (fullTypeName[i] == '.') 227else if (!IsIdentifierPartCharacter(fullTypeName[i]))
src\RoslynAnalyzers\Utilities\Compiler\WordParser.cs (2)
558char c = _text[_index++]; 576char c = _text[index];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher.Lexer.cs (6)
26if (headerText[Position] == '\\') 80switch (headerText[position]) 86headerText[position] == '*') 124public readonly char CurrentCharacter => headerText[Position]; 126public char EatCurrentCharacter() => headerText[Position++]; 142public readonly char this[int position] => headerText[position];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\AbstractVirtualCharService.cs (6)
33var ch = tokenText[index]; 34var next = tokenText[index + 1]; 165if (tokenText[index] == '"' && tokenText[index + 1] == '"') 171else if (escapeBraces && IsOpenOrCloseBrace(tokenText[index])) 176result.Add(VirtualChar.Create(new Rune(tokenText[index]), span));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\AbstractVirtualCharService.ITextInfo.cs (1)
29public readonly char Get(string text, int index) => text[index];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\VirtualCharSequence.Chunks.cs (3)
102if (char.IsHighSurrogate(data[index])) 105!char.IsLowSurrogate(data[index + 1])); 110var ch = data[index];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\StringExtensions.cs (8)
20if (!char.IsWhiteSpace(line[i])) 35if (!char.IsWhiteSpace(line[i])) 87if (textSnippet[i] == '\t') 109if (predicate(text[i])) 158if (text[i] == '\n') 162else if (text[i] == '\r') 164if (i + 1 == text.Length || text[i + 1] != '\n') 230if (line[i] == '\t')
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\FormattingExtensions.cs (3)
228if (text[i] is not ' ' and not '\t') 245if (i >= newText.Length || text[i] != newText[i])
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\TriviaEngine\AbstractTriviaFormatter.cs (5)
147if (!IsWhitespace(text[i]) || !IsNewLine(text[i])) 503if (!char.IsWhiteSpace(this.OriginalString[i])) 533if (!IsWhitespace(this.OriginalString[i])) 743if (this.OriginalString[i] == '\n')
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.cs (11)
180private static readonly Func<string, TextSpan, bool> s_firstCharIsLowerCase = (val, span) => !DoesCharacterHaveCasing(val[span.Start]) || char.IsLower(val[span.Start]); 181private static readonly Func<string, TextSpan, bool> s_firstCharIsUpperCase = (val, span) => !DoesCharacterHaveCasing(val[span.Start]) || char.IsUpper(val[span.Start]); 187if (DoesCharacterHaveCasing(val[i]) && !char.IsUpper(val[i])) 200if (DoesCharacterHaveCasing(val[i]) && !char.IsLower(val[i])) 348switch (char.ToLowerInvariant(name[index])) 353if (index + 2 < name.Length && name[index + 1] == '_') 362if (index + 1 < name.Length && !char.IsDigit(name[index + 1]))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\ISyntaxFactsExtensions.cs (1)
263if (!syntaxFacts.IsIdentifierPartCharacter(name[i]))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (16)
65Debug.Assert(Data[Position] == c); 87Debug.Assert(char.IsNumber(Data[Position])); 92while (char.IsNumber(Data[Position])) 94var digit = Data[Position] - '0'; 139if ((SymbolKeyType)Data[Position] == SymbolKeyType.Null) 152if (Data[Position] != DoubleQuoteChar) 160if (Data[Position + 1] == DoubleQuoteChar) 202Debug.Assert((SymbolKeyType)Data[Position] != SymbolKeyType.Null); 261var ch = Data[Position]; 266var type = (SymbolKeyType)Data[Position]; 272else if (Data[Position] == DoubleQuoteChar) 306_builder.Append(Data[i]); 474var type = (SymbolKeyType)Data[Position]; 485type = (SymbolKeyType)Data[Position]; 547Debug.Assert((SymbolKeyType)Data[Position] != SymbolKeyType.Null); 646if ((SymbolKeyType)Data[Position] == SymbolKeyType.Null)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\Base64Utilities.cs (1)
338while (index >= 0 && attributeData[index] == '=')
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BKTree.cs (1)
79lowerCaseCharacters[i] = CaseInsensitiveComparison.ToLower(value[i]);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EditDistance.cs (2)
62array[i] = CaseInsensitiveComparison.ToLower(text[i]); 94targetLowerCaseCharacters[i] = CaseInsensitiveComparison.ToLower(target[i]);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\StringBreaker.cs (9)
46var firstChar = identifier[wordStart]; 86var c = identifier[current]; 108var c = identifier[current]; 118while (current < length && char.IsUpper(identifier[current])) 123if (current < length && IsLower(identifier[current])) 126Debug.Assert(char.IsUpper(identifier[current - 1])); 153while (current < length && IsLower(identifier[current])) 164while (current < length && char.IsDigit(identifier[current])) 176var ch = identifier[wordStart];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\StringEscapeEncoder.cs (2)
46builder.AppendFormat("{0:X2}", (int)text[index]); 105var ch = text[i];
Metrics.Legacy (110)
src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (12)
53while (lastSeparator > 0 && IsDirectorySeparator(s[lastSeparator - 1])) 71if (s.Length == 0 || IsAnyDirectorySeparator(s[s.Length - 1])) 145if (IsDirectorySeparator(path[i])) 147if (i > 0 && IsDirectorySeparator(path[i - 1])) 240if (!IsDirectorySeparator(path[i])) 276while (i < length && IsDirectorySeparator(path[i])) 440char c = root[root.Length - 1]; 479if (path.Length > 0 && IsDirectorySeparator(path[path.Length - 1])) 611&& (IsDirectorySeparator(parentPath[parentPath.Length - 1]) || IsDirectorySeparator(childPath[parentPath.Length])); 663if (!PathCharEqual(path1[i], path2[i]))
src\Compilers\Core\Portable\InternalUtilities\FileNameUtilities.cs (2)
122if (path.Length > 0 && path[path.Length - 1] == '.') 175char ch = path[i];
src\Compilers\Core\Portable\InternalUtilities\StringExtensions.cs (7)
173char c = str[i++]; 178if (i < str.Length && char.IsLowSurrogate(str[i])) 208if (arg.Length > 1 && arg[0] == '"' && arg[arg.Length - 1] == '"') 224char.ToUpper(string1[x]) == char.ToUpper(string2[x])) 236string1[x] == string2[x])
src\Compilers\Core\Portable\InternalUtilities\StringTable.cs (4)
489if (array[i] != text[start + i]) 519if (array[i] != text[i]) 545if (ascii[i] != text[i])
src\Compilers\Core\Portable\InternalUtilities\UnicodeCharacterUtilities.cs (1)
106if (!IsIdentifierPartCharacter(name[i]))
src\Compilers\Core\Portable\Syntax\SyntaxTreeExtensions.cs (4)
65found = fromNode[index]; 66expected = fromText[index]; 100if (s1[i] != s2[i])
src\RoslynAnalyzers\Utilities\Compiler\Options\AnalyzerOptionsExtensions.cs (1)
365if (trimmedSuffix[i] != ' ')
src\RoslynAnalyzers\Utilities\Compiler\WellKnownTypeProvider.cs (2)
222if (fullTypeName[i] == '.') 227else if (!IsIdentifierPartCharacter(fullTypeName[i]))
src\RoslynAnalyzers\Utilities\Compiler\WordParser.cs (2)
558char c = _text[_index++]; 576char c = _text[index];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher.Lexer.cs (6)
26if (headerText[Position] == '\\') 80switch (headerText[position]) 86headerText[position] == '*') 124public readonly char CurrentCharacter => headerText[Position]; 126public char EatCurrentCharacter() => headerText[Position++]; 142public readonly char this[int position] => headerText[position];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\AbstractVirtualCharService.cs (6)
33var ch = tokenText[index]; 34var next = tokenText[index + 1]; 165if (tokenText[index] == '"' && tokenText[index + 1] == '"') 171else if (escapeBraces && IsOpenOrCloseBrace(tokenText[index])) 176result.Add(VirtualChar.Create(new Rune(tokenText[index]), span));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\AbstractVirtualCharService.ITextInfo.cs (1)
29public readonly char Get(string text, int index) => text[index];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\VirtualCharSequence.Chunks.cs (3)
102if (char.IsHighSurrogate(data[index])) 105!char.IsLowSurrogate(data[index + 1])); 110var ch = data[index];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\StringExtensions.cs (8)
20if (!char.IsWhiteSpace(line[i])) 35if (!char.IsWhiteSpace(line[i])) 87if (textSnippet[i] == '\t') 109if (predicate(text[i])) 158if (text[i] == '\n') 162else if (text[i] == '\r') 164if (i + 1 == text.Length || text[i + 1] != '\n') 230if (line[i] == '\t')
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\FormattingExtensions.cs (3)
228if (text[i] is not ' ' and not '\t') 245if (i >= newText.Length || text[i] != newText[i])
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\TriviaEngine\AbstractTriviaFormatter.cs (5)
147if (!IsWhitespace(text[i]) || !IsNewLine(text[i])) 503if (!char.IsWhiteSpace(this.OriginalString[i])) 533if (!IsWhitespace(this.OriginalString[i])) 743if (this.OriginalString[i] == '\n')
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.cs (11)
180private static readonly Func<string, TextSpan, bool> s_firstCharIsLowerCase = (val, span) => !DoesCharacterHaveCasing(val[span.Start]) || char.IsLower(val[span.Start]); 181private static readonly Func<string, TextSpan, bool> s_firstCharIsUpperCase = (val, span) => !DoesCharacterHaveCasing(val[span.Start]) || char.IsUpper(val[span.Start]); 187if (DoesCharacterHaveCasing(val[i]) && !char.IsUpper(val[i])) 200if (DoesCharacterHaveCasing(val[i]) && !char.IsLower(val[i])) 348switch (char.ToLowerInvariant(name[index])) 353if (index + 2 < name.Length && name[index + 1] == '_') 362if (index + 1 < name.Length && !char.IsDigit(name[index + 1]))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\ISyntaxFactsExtensions.cs (1)
263if (!syntaxFacts.IsIdentifierPartCharacter(name[i]))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (16)
65Debug.Assert(Data[Position] == c); 87Debug.Assert(char.IsNumber(Data[Position])); 92while (char.IsNumber(Data[Position])) 94var digit = Data[Position] - '0'; 139if ((SymbolKeyType)Data[Position] == SymbolKeyType.Null) 152if (Data[Position] != DoubleQuoteChar) 160if (Data[Position + 1] == DoubleQuoteChar) 202Debug.Assert((SymbolKeyType)Data[Position] != SymbolKeyType.Null); 261var ch = Data[Position]; 266var type = (SymbolKeyType)Data[Position]; 272else if (Data[Position] == DoubleQuoteChar) 306_builder.Append(Data[i]); 474var type = (SymbolKeyType)Data[Position]; 485type = (SymbolKeyType)Data[Position]; 547Debug.Assert((SymbolKeyType)Data[Position] != SymbolKeyType.Null); 646if ((SymbolKeyType)Data[Position] == SymbolKeyType.Null)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\Base64Utilities.cs (1)
338while (index >= 0 && attributeData[index] == '=')
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BKTree.cs (1)
79lowerCaseCharacters[i] = CaseInsensitiveComparison.ToLower(value[i]);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EditDistance.cs (2)
62array[i] = CaseInsensitiveComparison.ToLower(text[i]); 94targetLowerCaseCharacters[i] = CaseInsensitiveComparison.ToLower(target[i]);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\StringBreaker.cs (9)
46var firstChar = identifier[wordStart]; 86var c = identifier[current]; 108var c = identifier[current]; 118while (current < length && char.IsUpper(identifier[current])) 123if (current < length && IsLower(identifier[current])) 126Debug.Assert(char.IsUpper(identifier[current - 1])); 153while (current < length && IsLower(identifier[current])) 164while (current < length && char.IsDigit(identifier[current])) 176var ch = identifier[wordStart];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\StringEscapeEncoder.cs (2)
46builder.AppendFormat("{0:X2}", (int)text[index]); 105var ch = text[i];
Microsoft.Analyzers.Extra (2)
CallAnalysis\Fixers\LegacyLoggingFixer.FixDetails.cs (2)
298if (braceOccurrenceCount > 0 && message[scanIndex] != brace) 314else if (message[scanIndex] == brace)
Microsoft.Analyzers.Local (4)
ApiLifecycle\Json\TextScanner.cs (1)
131Assert(next[i]);
ApiLifecycle\Utils.cs (3)
78if (baseTypesString[i] == '<') 82else if (baseTypesString[i] == '>') 86else if (generic == 0 && baseTypesString[i] == ',')
Microsoft.Arcade.Common (4)
ArgumentEscaper.cs (4)
57while (i < argument.Length && argument[i] == '\\') 72else if (argument[i] == '"') 82sb.Append(argument[i]); 139return argument.Length > 1 && (argument[0] == '\"' || argument[argument.Length - 1] == '\"');
Microsoft.AspNetCore.App.Analyzers (26)
Infrastructure\RoutePattern\RoutePatternLexer.cs (1)
78Text[position + i].Value != val[i])
Infrastructure\VirtualChars\AbstractVirtualCharService.cs (6)
31var ch = tokenText[index]; 32var next = tokenText[index + 1]; 162if (tokenText[index] == '"' && tokenText[index + 1] == '"') 168else if (escapeBraces && IsOpenOrCloseBrace(tokenText[index])) 175result.Add(VirtualChar.Create(new Rune(tokenText[index]), span));
Infrastructure\VirtualChars\AbstractVirtualCharService.ITextInfo.cs (1)
28public char Get(string text, int index) => text[index];
Infrastructure\VirtualChars\CSharpVirtualCharService.cs (15)
154while (tokenText[startIndexInclusive] == '"') 157if (!(tokenText[endIndexExclusive - 1] == '"')) 273var ch = tokenText[index]; 351Debug.Assert(tokenText[index] == '\\'); 364Debug.Assert(tokenText[index] == '\\'); 366var ch = tokenText[index + 1]; 397Debug.Assert(tokenText[index] == '\\'); 399var ch = tokenText[index + 1]; 416Debug.Assert(tokenText[index] == '\\'); 425if (!IsHexDigit(tokenText[index])) 433character = tokenText[index + i]; 477if (!IsHexDigit(tokenText[index])) 485var ch2 = tokenText[index + i]; 505if (!IsHexDigit(tokenText[index])) 514var ch2 = tokenText[index + i];
Infrastructure\VirtualChars\VirtualCharSequence.Chunks.cs (3)
148if (char.IsHighSurrogate(_underlyingData[index])) 151!char.IsLowSurrogate(_underlyingData[index + 1])); 156var ch = _underlyingData[index];
Microsoft.AspNetCore.App.Analyzers.Test (1)
TestDiagnosticAnalyzer.cs (1)
42var insertionChar = source[caretPosition - 1];
Microsoft.AspNetCore.Components (11)
Rendering\SimplifiedStringHashComparer.cs (2)
34char.ToLowerInvariant(key[keyLength - 1]) 35+ 31 * char.ToLowerInvariant(key[keyLength / 2])
src\Http\Routing\src\PathTokenizer.cs (3)
60if (_path[i] == '/') 97Debug.Assert(_path[_path.Length - 1] != '/'); 186if (_path[_path.Length - 1] == '/')
src\Http\Routing\src\Patterns\RouteParameterParser.cs (5)
43if (parameter[endIndex] == '?') 56var currentChar = parameter[currentIndex]; 82parameter[currentIndex] == '=') 109var currentChar = currentIndex > endIndex ? null : (char?)text[currentIndex]; 145var nextChar = currentIndex + 1 > endIndex ? null : (char?)text[currentIndex + 1];
src\Http\Routing\src\Patterns\RoutePatternParser.cs (1)
493get { return (_index < _template.Length && _index >= 0) ? _template[_index] : (char)0; }
Microsoft.AspNetCore.Components.Endpoints (1)
FormMapping\HttpContextFormValueMapper.cs (1)
58&& incomingScopeQualifiedFormName[currentMappingScopeName.Length + 1] == ']')
Microsoft.AspNetCore.Components.Web (3)
Forms\Mapping\FormMappingError.cs (1)
64if (path[lastSeparatorIndex] == '[')
Routing\NavLink.cs (2)
242|| !IsUnreservedCharacter(prefix[prefixLength - 1]) 243|| !IsUnreservedCharacter(value[prefixLength])
Microsoft.AspNetCore.Cryptography.Internal.Tests (3)
SafeHandles\SecureLocalAllocHandleTests.cs (1)
20((char*)controlHandle.DangerousGetHandle())[i] = expected[i];
UnsafeBufferUtilTests.cs (2)
49((char*)controlHandle.DangerousGetHandle())[i] = expected[i]; 71((char*)controlHandle.DangerousGetHandle())[i] = expected[i];
Microsoft.AspNetCore.DataProtection.Abstractions (1)
src\Shared\WebEncoders\WebEncoders.cs (1)
180var ch = input[j];
Microsoft.AspNetCore.Grpc.JsonTranscoding (19)
Internal\JsonRequestHelpers.cs (1)
428variable[bodyFieldName.Length] == '.')
src\Grpc\JsonTranscoding\src\Shared\HttpRoutePatternParser.cs (1)
310private char? CurrentChar => _tokenStart < _tokenEnd && _tokenEnd <= _input.Length ? _input[_tokenEnd - 1] : null;
src\Grpc\JsonTranscoding\src\Shared\Legacy.cs (5)
282char c = text[i]; 297(text[i + 1] >= 'a' && text[i + 1] <= 'z')))) // ascii_islower(text[i + 1]) 352var c = input[i]; 359var next = input[i + 1];
src\Grpc\JsonTranscoding\src\Shared\ServiceDescriptorHelpers.cs (10)
619if (char.IsLower(input[i])) 623result += char.ToUpper(input[i], CultureInfo.InvariantCulture); 627result += input[i]; 631else if (char.IsUpper(input[i])) 637result += char.ToLower(input[i], CultureInfo.InvariantCulture); 642result += input[i]; 646else if (char.IsDigit(input[i])) 648result += input[i]; 654if (input[i] == '.' && preservePeriod) 661if (input.Length > 0 && input[input.Length - 1] == '#')
src\Grpc\JsonTranscoding\src\Shared\X509CertificateHelpers.cs (2)
148s_delimiter = x509ExtensionFormattedString[delimiterIndex]; 160if (x509ExtensionFormattedString[i] == s_identifier[0])
Microsoft.AspNetCore.Grpc.Swagger (16)
src\Grpc\JsonTranscoding\src\Shared\HttpRoutePatternParser.cs (1)
310private char? CurrentChar => _tokenStart < _tokenEnd && _tokenEnd <= _input.Length ? _input[_tokenEnd - 1] : null;
src\Grpc\JsonTranscoding\src\Shared\Legacy.cs (5)
282char c = text[i]; 297(text[i + 1] >= 'a' && text[i + 1] <= 'z')))) // ascii_islower(text[i + 1]) 352var c = input[i]; 359var next = input[i + 1];
src\Grpc\JsonTranscoding\src\Shared\ServiceDescriptorHelpers.cs (10)
619if (char.IsLower(input[i])) 623result += char.ToUpper(input[i], CultureInfo.InvariantCulture); 627result += input[i]; 631else if (char.IsUpper(input[i])) 637result += char.ToLower(input[i], CultureInfo.InvariantCulture); 642result += input[i]; 646else if (char.IsDigit(input[i])) 648result += input[i]; 654if (input[i] == '.' && preservePeriod) 661if (input.Length > 0 && input[input.Length - 1] == '#')
Microsoft.AspNetCore.Http (1)
BindingAddress.cs (1)
252if (address[address.Length - 1] == '/')
Microsoft.AspNetCore.Http.Abstractions (7)
Internal\HeaderSegmentCollection.cs (1)
179char ch = _offset == _headerLength ? (char)0 : _header[_offset];
Internal\ParsingHelpers.cs (2)
69(value[0] != '"' || value[value.Length - 1] != '"')) 79(value.Length > 1 && value[0] == '"' && value[value.Length - 1] == '"'))
PathString.cs (4)
100if (s_validPathChars.Contains(value[i]) || (isPercentEncodedChar = Uri.IsHexEncoding(value, i))) 245return value1.Length == value2.Length || value1[value2.Length] == '/'; 288if (value1.Length == value2.Length || value1[value2.Length] == '/') 338if (value1.Length == value2.Length || value1[value2.Length] == '/')
Microsoft.AspNetCore.Http.RequestDelegateGenerator (3)
StaticRouteHandlerModel\EndpointParameter.cs (3)
545if (s[index] is '\n' or '\r' or '"' or '\\') 562switch (s[index]) 585sb.Append(s[index]);
Microsoft.AspNetCore.HttpLogging (1)
W3CLoggingMiddleware.cs (1)
247var ch = entry[i];
Microsoft.AspNetCore.HttpOverrides (1)
ForwardedHeadersMiddleware.cs (1)
472if (hostText[offset] != ':' || hostText.Length == offset + 1)
Microsoft.AspNetCore.Identity.FunctionalTests (16)
src\Identity\Extensions.Core\src\Base32.cs (16)
37buffer[index + 7] = ((numCharsToOutput >= 8) ? _base32Chars[h] : '='); 38buffer[index + 6] = ((numCharsToOutput >= 7) ? _base32Chars[g] : '='); 39buffer[index + 5] = ((numCharsToOutput >= 6) ? _base32Chars[f] : '='); 40buffer[index + 4] = ((numCharsToOutput >= 5) ? _base32Chars[e] : '='); 41buffer[index + 3] = ((numCharsToOutput >= 4) ? _base32Chars[d] : '='); 42buffer[index + 2] = (numCharsToOutput >= 3) ? _base32Chars[c] : '='; 43buffer[index + 1] = (numCharsToOutput >= 2) ? _base32Chars[b] : '='; 44buffer[index] = (numCharsToOutput >= 1) ? _base32Chars[a] : '='; 61sb.Append((numCharsToOutput >= 1) ? _base32Chars[a] : '='); 62sb.Append((numCharsToOutput >= 2) ? _base32Chars[b] : '='); 63sb.Append((numCharsToOutput >= 3) ? _base32Chars[c] : '='); 64sb.Append((numCharsToOutput >= 4) ? _base32Chars[d] : '='); 65sb.Append((numCharsToOutput >= 5) ? _base32Chars[e] : '='); 66sb.Append((numCharsToOutput >= 6) ? _base32Chars[f] : '='); 67sb.Append((numCharsToOutput >= 7) ? _base32Chars[g] : '='); 68sb.Append((numCharsToOutput >= 8) ? _base32Chars[h] : '=');
Microsoft.AspNetCore.JsonPatch (5)
Internal\ParsedPath.cs (5)
49if (path[i] == '/') 57else if (path[i] == '~') 65if (path[i] == '0') 69else if (path[i] == '1') 80sb.Append(path[i]);
Microsoft.AspNetCore.JsonPatch.SystemTextJson (5)
Internal\ParsedPath.cs (5)
44if (path[i] == '/') 52else if (path[i] == '~') 60if (path[i] == '0') 64else if (path[i] == '1') 75sb.Append(path[i]);
Microsoft.AspNetCore.Mvc.Abstractions (2)
ModelBinding\ModelStateDictionary.cs (2)
597var ch = key[index]; 792var charAfterPrefix = key[prefix.Length];
Microsoft.AspNetCore.Mvc.Api.Analyzers (3)
SymbolApiConventionMatcher.cs (3)
146return char.IsUpper(name[conventionName.Length]); 165if (!char.IsLower(name[index])) 172if (name[index] != char.ToUpperInvariant(conventionName[0]))
Microsoft.AspNetCore.Mvc.Core (15)
ApiExplorer\ApiConventionMatcher.cs (3)
126return char.IsUpper(name[conventionName.Length]); 150if (!char.IsLower(name[index])) 157if (name[index] != char.ToUpperInvariant(conventionName[0]))
ApplicationModels\AttributeRouteModel.cs (1)
275var c = i < template.Length ? (char?)template[i] : null;
Formatters\AcceptHeaderParser.cs (2)
130if ((current == input.Length) || (input[current] != ',')) 141while ((current < input.Length) && (input[current] == ','))
Formatters\MediaType.cs (2)
343if (OffsetIsOutOfRange(startIndex, input.Length) || input[startIndex] != ';') 353if (nameLength == 0 || OffsetIsOutOfRange(current, input.Length) || input[current] != '=')
ModelBinding\JQueryKeyValuePairNormalizer.cs (1)
80else if (char.IsDigit(key[indexOpen + 1]))
ModelBinding\PrefixContainer.cs (3)
141switch (entry[prefix.Length]) 212var c = candidate[prefix.Length]; 269var c = candidate[prefix.Length];
src\Shared\MediaType\ReadOnlyMediaTypeHeaderValue.cs (3)
120if (current < 0 || current >= input.Length || input[current] != '/') 495if (OffsetIsOutOfRange(startIndex, input.Length) || input[startIndex] != ';') 505if (nameLength == 0 || OffsetIsOutOfRange(current, input.Length) || input[current] != '=')
Microsoft.AspNetCore.Mvc.NewtonsoftJson (3)
NewtonsoftJsonInputFormatter.cs (3)
369if (path[index] == '[') 381else if (path[index] == '.' || path[index] == ']')
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation (4)
ChecksumValidator.cs (2)
129if (checksum[i * 2] != text[0] || checksum[i * 2 + 1] != text[1])
FileProviderRazorProjectItem.cs (2)
81(PhysicalPath[_root.Length] == Path.DirectorySeparatorChar || PhysicalPath[_root.Length] == Path.AltDirectorySeparatorChar))
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation.Test (1)
TestInfrastructure\DirectoryNode.cs (1)
114if (path[path.Length - 1] != '/')
Microsoft.AspNetCore.Mvc.RazorPages (2)
ApplicationModels\DefaultPageApplicationModelPartsProvider.cs (1)
250if (char.IsUpper(methodName[handlerNameStart]))
ApplicationModels\PageConventionCollection.cs (1)
400viewEnginePath[folderPath.Length] == '/';
Microsoft.AspNetCore.Mvc.TagHelpers (1)
GlobbingUrlBuilder.cs (1)
307var ch = value[index];
Microsoft.AspNetCore.OpenApi.SourceGenerators (1)
Helpers\StringExtensions.cs (1)
35while (leadingWhitespace < line.Length && char.IsWhiteSpace(line[leadingWhitespace]))
Microsoft.AspNetCore.OutputCaching (1)
StringBuilderExtensions.cs (1)
17builder.Append(char.ToUpperInvariant(value[i]));
Microsoft.AspNetCore.OutputCaching.Tests (2)
OutputCacheEntryFormatterTests.cs (2)
110arr[i] = (byte)((Nibble(hex[index++]) << 4) | Nibble(hex[index++]));
Microsoft.AspNetCore.ResponseCaching (1)
StringBuilderExtensions.cs (1)
17builder.Append(char.ToUpperInvariant(value[i]));
Microsoft.AspNetCore.Rewrite (3)
ApacheModRewrite\CookieActionFactory.cs (1)
34if (flagValue[i] == separator)
ApacheModRewrite\FlagParser.cs (1)
61if (!(flagString[0] == '[' && flagString[flagString.Length - 1] == ']'))
ParserContext.cs (1)
21public char Current => (Index < Template.Length && Index >= 0) ? Template[Index] : (char)0;
Microsoft.AspNetCore.Routing (18)
InlineRouteParameterParser.cs (5)
44if (routeParameter[endIndex] == '?') 57var currentChar = routeParameter[currentIndex]; 83routeParameter[currentIndex] == '=') 105var currentChar = currentIndex > endIndex ? null : (char?)routeParameter[currentIndex]; 141var nextChar = currentIndex + 1 > endIndex ? null : (char?)routeParameter[currentIndex + 1];
Matching\ILEmitTrieFactory.cs (1)
553return (ushort)char.ToLowerInvariant(text[index]);
PathTokenizer.cs (3)
60if (_path[i] == '/') 97Debug.Assert(_path[_path.Length - 1] != '/'); 186if (_path[_path.Length - 1] == '/')
Patterns\RouteParameterParser.cs (5)
43if (parameter[endIndex] == '?') 56var currentChar = parameter[currentIndex]; 82parameter[currentIndex] == '=') 109var currentChar = currentIndex > endIndex ? null : (char?)text[currentIndex]; 145var nextChar = currentIndex + 1 > endIndex ? null : (char?)text[currentIndex + 1];
Patterns\RoutePatternParser.cs (1)
493get { return (_index < _template.Length && _index >= 0) ? _template[_index] : (char)0; }
src\Shared\MediaType\ReadOnlyMediaTypeHeaderValue.cs (3)
120if (current < 0 || current >= input.Length || input[current] != '/') 495if (OffsetIsOutOfRange(startIndex, input.Length) || input[startIndex] != ';') 505if (nameLength == 0 || OffsetIsOutOfRange(current, input.Length) || input[current] != '=')
Microsoft.AspNetCore.Routing.Microbenchmarks (2)
Matching\JumpTableMultipleEntryBenchmark.cs (2)
165buffer[c] = char.ToUpperInvariant(state[c]); 169buffer[c] = ((char)(state[c] + ('G' - '0')));
Microsoft.AspNetCore.Server.HttpSys (6)
RequestProcessing\Request.cs (4)
114var baseValue = pathBase[baseOffset]; 115var offsetValue = originalPath[originalOffset]; 135else if (baseOffset > 0 && pathBase[baseOffset - 1] == '/' 141else if (baseOffset > 0 && pathBase[baseOffset - 1] == '/'
src\Shared\HttpSys\RequestProcessing\HeaderCollection.cs (1)
282=> throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture, "Invalid control character in header: 0x{0:X2}", headerCharacters[invalidIndex]));
src\Shared\HttpSys\RequestProcessing\HeaderParser.cs (1)
22char ch = value[current];
Microsoft.AspNetCore.Server.IIS (6)
Core\IISHttpContext.cs (4)
221var baseValue = pathBase[baseOffset]; 222var offsetValue = originalPath[originalOffset]; 242else if (baseOffset > 0 && pathBase[baseOffset - 1] == '/' 248else if (baseOffset > 0 && pathBase[baseOffset - 1] == '/'
src\Shared\HttpSys\RequestProcessing\HeaderCollection.cs (1)
282=> throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture, "Invalid control character in header: 0x{0:X2}", headerCharacters[invalidIndex]));
src\Shared\HttpSys\RequestProcessing\HeaderParser.cs (1)
22char ch = value[current];
Microsoft.AspNetCore.Server.Kestrel.Core (5)
Internal\Http\HttpHeaders.cs (2)
297ThrowInvalidHeaderCharacter(headerCharacters[invalid]); 307ThrowInvalidHeaderCharacter(headerCharacters[invalid]);
Internal\Infrastructure\HttpUtilities.cs (3)
529var ch = hostText[i]; 557var firstChar = hostText[offset]; 567if (!IsNumeric(hostText[i]))
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (4)
AsciiDecoding.cs (2)
45var sb = (byte)s[i]; 82var sb = (byte)((s[i] & 0x7f) | 0x01);
src\Servers\Kestrel\shared\KnownHeaders.cs (1)
515var ch = (byte)name[offset + count - scan - 1];
src\Servers\Kestrel\shared\test\StreamBackedTestConnection.cs (1)
83var ch = text[index];
Microsoft.AspNetCore.Shared.Tests (5)
src\Shared\CommandLineUtils\CommandLine\AnsiConsole.cs (3)
78message[endIndex] >= 0x20 && 79message[endIndex] <= 0x3f) 91switch (message[endIndex])
src\Shared\HttpSys\RequestProcessing\HeaderCollection.cs (1)
282=> throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture, "Invalid control character in header: 0x{0:X2}", headerCharacters[invalidIndex]));
src\Shared\HttpSys\RequestProcessing\HeaderParser.cs (1)
22char ch = value[current];
Microsoft.AspNetCore.SignalR.Common.Tests (1)
Internal\Protocol\Utf8BufferTextWriterTests.cs (1)
113Assert.Equal('\u00A3', result[i + 2]);
Microsoft.Build.Framework (1)
FileClassifier.cs (1)
341return (fileSpec.Length > 0) && IsSlash(fileSpec[fileSpec.Length - 1]);
Microsoft.Build.Tasks.CodeAnalysis (4)
src\Compilers\Core\MSBuildTask\Csc.cs (1)
417if (index >= 0 && itemSpec[index] == '=')
src\Compilers\Core\MSBuildTask\MapSourceRoots.cs (2)
75=> (path[path.Length - 1] == '/') ? path : path + '/'; 84char c = path[path.Length - 1];
src\Compilers\Core\Portable\InternalUtilities\UnicodeCharacterUtilities.cs (1)
106if (!IsIdentifierPartCharacter(name[i]))
Microsoft.Build.Tasks.CodeAnalysis.Sdk (4)
src\Compilers\Core\MSBuildTask\Csc.cs (1)
417if (index >= 0 && itemSpec[index] == '=')
src\Compilers\Core\MSBuildTask\MapSourceRoots.cs (2)
75=> (path[path.Length - 1] == '/') ? path : path + '/'; 84char c = path[path.Length - 1];
src\Compilers\Core\Portable\InternalUtilities\UnicodeCharacterUtilities.cs (1)
106if (!IsIdentifierPartCharacter(name[i]))
Microsoft.CodeAnalysis (119)
CaseInsensitiveComparison.cs (9)
114int ordDiff = CompareLowerUnicode(str1[i], str2[i]); 165if (!AreEqualLowerUnicode(str1[i], str2[i])) 214if (!AreEqualLowerUnicode(value[i], possibleEnd[j])) 245if (!AreEqualLowerUnicode(value[i], possibleStart[i])) 260hashCode = Hash.CombineFNVHash(hashCode, ToLower(str[i]));
CommandLine\AnalyzerConfig.SectionNameMatching.cs (5)
474switch (_sectionName[Position]) 480_sectionName[nextPos] == '*') 530public char CurrentCharacter => _sectionName[Position]; 535public char EatCurrentCharacter() => _sectionName[Position++]; 555public char this[int position] => _sectionName[position];
CommandLine\AnalyzerConfigSet.cs (1)
221if (config.NormalizedDirectory[dirLength - 1] == '/')
CommandLine\CommandLineParser.cs (6)
116if (optionName[i] != char.ToLowerInvariant(ch)) 339char c = path[i]; 409char c = str[i++]; 412if (i < str.Length && str[i] == separator) 798if (!(arg[optionName.Length] == ':' || arg[optionName.Length] == '='))
DiagnosticAnalyzer\SuppressMessageAttributeState.TargetSymbolResolver.cs (4)
289return _index >= _name.Length ? '\0' : _name[_index]; 296while (_index < _name.Length && char.IsDigit(_name[_index])) 298n = n * 10 + (_name[_index] - '0'); 456for (; _index < _name.Length && _name[_index] != '}'; ++_index) { }
DiaSymReader\Metadata\SymWriterMetadataAdapter.cs (1)
125*dst = nameStr[i];
DiaSymReader\Utilities\InteropUtilities.cs (2)
68*dst = namespaceStr[i]; 81*dst = nameStr[i];
DiaSymReader\Writer\SymUnmanagedWriterImpl.cs (2)
435char c = str[i++]; 440if (i < str.Length && char.IsLowSurrogate(str[i]))
DocumentationCommentId.cs (3)
1517return index >= id.Length ? '\0' : id[index]; 1556while (index < id.Length && char.IsDigit(id[index])) 1558n = n * 10 + (id[index] - '0');
FileSystem\PathUtilities.cs (12)
53while (lastSeparator > 0 && IsDirectorySeparator(s[lastSeparator - 1])) 71if (s.Length == 0 || IsAnyDirectorySeparator(s[s.Length - 1])) 145if (IsDirectorySeparator(path[i])) 147if (i > 0 && IsDirectorySeparator(path[i - 1])) 240if (!IsDirectorySeparator(path[i])) 276while (i < length && IsDirectorySeparator(path[i])) 440char c = root[root.Length - 1]; 479if (path.Length > 0 && IsDirectorySeparator(path[path.Length - 1])) 611&& (IsDirectorySeparator(parentPath[parentPath.Length - 1]) || IsDirectorySeparator(childPath[parentPath.Length])); 663if (!PathCharEqual(path1[i], path2[i]))
InternalUtilities\FileNameUtilities.cs (2)
122if (path.Length > 0 && path[path.Length - 1] == '.') 175char ch = path[i];
InternalUtilities\JsonWriter.cs (1)
274char c = value[i];
InternalUtilities\StringExtensions.cs (7)
173char c = str[i++]; 178if (i < str.Length && char.IsLowSurrogate(str[i])) 208if (arg.Length > 1 && arg[0] == '"' && arg[arg.Length - 1] == '"') 224char.ToUpper(string1[x]) == char.ToUpper(string2[x])) 236string1[x] == string2[x])
InternalUtilities\StringTable.cs (3)
489if (array[i] != text[start + i]) 545if (ascii[i] != text[i])
InternalUtilities\UnicodeCharacterUtilities.cs (1)
106if (!IsIdentifierPartCharacter(name[i]))
MetadataReader\MetadataHelpers.cs (5)
132return _input[_offset]; 162char c = _input[i]; 315Debug.Assert(i == _input.Length || s_typeNameDelimiters.Contains(_input[i])); 686switch (pstrName[i]) 1059fullyQualified[namespaceName.Length] == MetadataHelpers.DotDelimiter &&
MetadataReader\ModuleExtensions.cs (1)
175emittedMethodName[index] != '_' ||
MetadataReference\AssemblyIdentity.DisplayName.cs (16)
247if (displayName[position] != ',') 260if (position >= displayName.Length || displayName[position] != '=') 462else if (!IsWhiteSpace(displayName[i])) 471if (IsQuote(displayName[i])) 473quote = displayName[i++]; 492char c = displayName[i]; 525while (j >= valueStart && IsWhiteSpace(displayName[j])) 537char c = displayName[i]; 552Debug.Assert(i == displayName.Length || IsNameTokenTerminator(displayName[i])); 619char c = (i < str.Length) ? str[i++] : '\0'; 712int hi = HexValue(value[i * 2]); 713int lo = HexValue(value[i * 2 + 1]); 762if (IsWhiteSpace(name[0]) || IsWhiteSpace(name[name.Length - 1])) 770char c = name[i]; 813char c = str[i++]; 839char c = str[i++];
PEWriter\MetadataWriter.DynamicAnalysis.cs (1)
256if (str[i] == c)
RealParser.cs (17)
297while (i < source.Length && source[i] == '0') i++; 299while (i < source.Length && source[i] >= '0' && source[i] <= '9') 301if (source[i] == '0') 309mantissaBuilder.Append(source[i]); 314if (i < source.Length && source[i] == '.') 317while (i < source.Length && source[i] >= '0' && source[i] <= '9') 319if (source[i] == '0') 327mantissaBuilder.Append(source[i]); 334if (i < source.Length && (source[i] == 'e' || source[i] == 'E')) 339if (i < source.Length && (source[i] == '-' || source[i] == '+')) 341exponentSign = source[i]; 346while (i < source.Length && source[i] >= '0' && source[i] <= '9') lastExponent = ++i;
SourceGeneration\AdditionalSourcesCollection.cs (1)
46char c = hintName[i];
src\Dependencies\CodeAnalysis.Debugging\CustomDebugInfoReader.cs (6)
700switch (import[pos]) 730switch (import[pos]) 747switch (import[pos]) 752if (import[pos] != ':') 770if (import[pos] != ':') 788if (import[pos] != ':')
Symbols\Attributes\CommonAttributeData.cs (1)
115if (index < 0 || namespaceName[index] != '.')
Syntax\SyntaxTreeExtensions.cs (4)
65found = fromNode[index]; 66expected = fromText[index]; 100if (s1[i] != s2[i])
Text\StringText.cs (1)
63return _source[position];
Xml\XmlCharType.cs (7)
993return (s_PublicIdBitmap[ch >> 4] & (1 << (ch & 0xF))) != 0; 1092if ((GetCharProperties(str[i]) & fWhitespace) == 0) 1107if ((GetCharProperties(str[i]) & fCharData) == 0) 1109if (i + 1 >= str.Length || !(XmlCharType.IsHighSurrogate(str[i]) && XmlCharType.IsLowSurrogate(str[i + 1]))) 1131if (!IsDigit(str[i])) 1161if (!IsPubidChar(str[i]))
Microsoft.CodeAnalysis.Analyzers (114)
src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (12)
53while (lastSeparator > 0 && IsDirectorySeparator(s[lastSeparator - 1])) 71if (s.Length == 0 || IsAnyDirectorySeparator(s[s.Length - 1])) 145if (IsDirectorySeparator(path[i])) 147if (i > 0 && IsDirectorySeparator(path[i - 1])) 240if (!IsDirectorySeparator(path[i])) 276while (i < length && IsDirectorySeparator(path[i])) 440char c = root[root.Length - 1]; 479if (path.Length > 0 && IsDirectorySeparator(path[path.Length - 1])) 611&& (IsDirectorySeparator(parentPath[parentPath.Length - 1]) || IsDirectorySeparator(childPath[parentPath.Length])); 663if (!PathCharEqual(path1[i], path2[i]))
src\Compilers\Core\Portable\InternalUtilities\FileNameUtilities.cs (2)
122if (path.Length > 0 && path[path.Length - 1] == '.') 175char ch = path[i];
src\Compilers\Core\Portable\InternalUtilities\StringExtensions.cs (7)
173char c = str[i++]; 178if (i < str.Length && char.IsLowSurrogate(str[i])) 208if (arg.Length > 1 && arg[0] == '"' && arg[arg.Length - 1] == '"') 224char.ToUpper(string1[x]) == char.ToUpper(string2[x])) 236string1[x] == string2[x])
src\Compilers\Core\Portable\InternalUtilities\StringTable.cs (4)
489if (array[i] != text[start + i]) 519if (array[i] != text[i]) 545if (ascii[i] != text[i])
src\Compilers\Core\Portable\InternalUtilities\UnicodeCharacterUtilities.cs (1)
106if (!IsIdentifierPartCharacter(name[i]))
src\Compilers\Core\Portable\Syntax\SyntaxTreeExtensions.cs (4)
65found = fromNode[index]; 66expected = fromText[index]; 100if (s1[i] != s2[i])
src\RoslynAnalyzers\Microsoft.CodeAnalysis.BannedApiAnalyzers\Core\DocumentationCommentIdParser.cs (2)
82=> index >= id.Length ? '\0' : id[index]; 105while (index < id.Length && char.IsDigit(id[index]))
src\RoslynAnalyzers\Utilities\Compiler\Options\AnalyzerOptionsExtensions.cs (1)
365if (trimmedSuffix[i] != ' ')
src\RoslynAnalyzers\Utilities\Compiler\WellKnownTypeProvider.cs (2)
222if (fullTypeName[i] == '.') 227else if (!IsIdentifierPartCharacter(fullTypeName[i]))
src\RoslynAnalyzers\Utilities\Compiler\WordParser.cs (2)
558char c = _text[_index++]; 576char c = _text[index];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher.Lexer.cs (6)
26if (headerText[Position] == '\\') 80switch (headerText[position]) 86headerText[position] == '*') 124public readonly char CurrentCharacter => headerText[Position]; 126public char EatCurrentCharacter() => headerText[Position++]; 142public readonly char this[int position] => headerText[position];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\AbstractVirtualCharService.cs (6)
33var ch = tokenText[index]; 34var next = tokenText[index + 1]; 165if (tokenText[index] == '"' && tokenText[index + 1] == '"') 171else if (escapeBraces && IsOpenOrCloseBrace(tokenText[index])) 176result.Add(VirtualChar.Create(new Rune(tokenText[index]), span));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\AbstractVirtualCharService.ITextInfo.cs (1)
29public readonly char Get(string text, int index) => text[index];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\VirtualCharSequence.Chunks.cs (3)
102if (char.IsHighSurrogate(data[index])) 105!char.IsLowSurrogate(data[index + 1])); 110var ch = data[index];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\StringExtensions.cs (8)
20if (!char.IsWhiteSpace(line[i])) 35if (!char.IsWhiteSpace(line[i])) 87if (textSnippet[i] == '\t') 109if (predicate(text[i])) 158if (text[i] == '\n') 162else if (text[i] == '\r') 164if (i + 1 == text.Length || text[i + 1] != '\n') 230if (line[i] == '\t')
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\FormattingExtensions.cs (3)
228if (text[i] is not ' ' and not '\t') 245if (i >= newText.Length || text[i] != newText[i])
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\TriviaEngine\AbstractTriviaFormatter.cs (5)
147if (!IsWhitespace(text[i]) || !IsNewLine(text[i])) 503if (!char.IsWhiteSpace(this.OriginalString[i])) 533if (!IsWhitespace(this.OriginalString[i])) 743if (this.OriginalString[i] == '\n')
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.cs (11)
180private static readonly Func<string, TextSpan, bool> s_firstCharIsLowerCase = (val, span) => !DoesCharacterHaveCasing(val[span.Start]) || char.IsLower(val[span.Start]); 181private static readonly Func<string, TextSpan, bool> s_firstCharIsUpperCase = (val, span) => !DoesCharacterHaveCasing(val[span.Start]) || char.IsUpper(val[span.Start]); 187if (DoesCharacterHaveCasing(val[i]) && !char.IsUpper(val[i])) 200if (DoesCharacterHaveCasing(val[i]) && !char.IsLower(val[i])) 348switch (char.ToLowerInvariant(name[index])) 353if (index + 2 < name.Length && name[index + 1] == '_') 362if (index + 1 < name.Length && !char.IsDigit(name[index + 1]))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\ISyntaxFactsExtensions.cs (1)
263if (!syntaxFacts.IsIdentifierPartCharacter(name[i]))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (16)
65Debug.Assert(Data[Position] == c); 87Debug.Assert(char.IsNumber(Data[Position])); 92while (char.IsNumber(Data[Position])) 94var digit = Data[Position] - '0'; 139if ((SymbolKeyType)Data[Position] == SymbolKeyType.Null) 152if (Data[Position] != DoubleQuoteChar) 160if (Data[Position + 1] == DoubleQuoteChar) 202Debug.Assert((SymbolKeyType)Data[Position] != SymbolKeyType.Null); 261var ch = Data[Position]; 266var type = (SymbolKeyType)Data[Position]; 272else if (Data[Position] == DoubleQuoteChar) 306_builder.Append(Data[i]); 474var type = (SymbolKeyType)Data[Position]; 485type = (SymbolKeyType)Data[Position]; 547Debug.Assert((SymbolKeyType)Data[Position] != SymbolKeyType.Null); 646if ((SymbolKeyType)Data[Position] == SymbolKeyType.Null)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\Base64Utilities.cs (1)
338while (index >= 0 && attributeData[index] == '=')
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BKTree.cs (1)
79lowerCaseCharacters[i] = CaseInsensitiveComparison.ToLower(value[i]);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EditDistance.cs (2)
62array[i] = CaseInsensitiveComparison.ToLower(text[i]); 94targetLowerCaseCharacters[i] = CaseInsensitiveComparison.ToLower(target[i]);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\StringBreaker.cs (9)
46var firstChar = identifier[wordStart]; 86var c = identifier[current]; 108var c = identifier[current]; 118while (current < length && char.IsUpper(identifier[current])) 123if (current < length && IsLower(identifier[current])) 126Debug.Assert(char.IsUpper(identifier[current - 1])); 153while (current < length && IsLower(identifier[current])) 164while (current < length && char.IsDigit(identifier[current])) 176var ch = identifier[wordStart];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\StringEscapeEncoder.cs (2)
46builder.AppendFormat("{0:X2}", (int)text[index]); 105var ch = text[i];
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (1)
373if (p.Length > 0 && char.IsLetter(name[p.Start]))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\TypeInferenceService\AbstractTypeInferenceService.cs (1)
72var nextChar = name[prefix.Length];
Microsoft.CodeAnalysis.AnalyzerUtilities (110)
src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (12)
53while (lastSeparator > 0 && IsDirectorySeparator(s[lastSeparator - 1])) 71if (s.Length == 0 || IsAnyDirectorySeparator(s[s.Length - 1])) 145if (IsDirectorySeparator(path[i])) 147if (i > 0 && IsDirectorySeparator(path[i - 1])) 240if (!IsDirectorySeparator(path[i])) 276while (i < length && IsDirectorySeparator(path[i])) 440char c = root[root.Length - 1]; 479if (path.Length > 0 && IsDirectorySeparator(path[path.Length - 1])) 611&& (IsDirectorySeparator(parentPath[parentPath.Length - 1]) || IsDirectorySeparator(childPath[parentPath.Length])); 663if (!PathCharEqual(path1[i], path2[i]))
src\Compilers\Core\Portable\InternalUtilities\FileNameUtilities.cs (2)
122if (path.Length > 0 && path[path.Length - 1] == '.') 175char ch = path[i];
src\Compilers\Core\Portable\InternalUtilities\StringExtensions.cs (7)
173char c = str[i++]; 178if (i < str.Length && char.IsLowSurrogate(str[i])) 208if (arg.Length > 1 && arg[0] == '"' && arg[arg.Length - 1] == '"') 224char.ToUpper(string1[x]) == char.ToUpper(string2[x])) 236string1[x] == string2[x])
src\Compilers\Core\Portable\InternalUtilities\StringTable.cs (4)
489if (array[i] != text[start + i]) 519if (array[i] != text[i]) 545if (ascii[i] != text[i])
src\Compilers\Core\Portable\InternalUtilities\UnicodeCharacterUtilities.cs (1)
106if (!IsIdentifierPartCharacter(name[i]))
src\Compilers\Core\Portable\Syntax\SyntaxTreeExtensions.cs (4)
65found = fromNode[index]; 66expected = fromText[index]; 100if (s1[i] != s2[i])
src\RoslynAnalyzers\Utilities\Compiler\Options\AnalyzerOptionsExtensions.cs (1)
365if (trimmedSuffix[i] != ' ')
src\RoslynAnalyzers\Utilities\Compiler\WellKnownTypeProvider.cs (2)
222if (fullTypeName[i] == '.') 227else if (!IsIdentifierPartCharacter(fullTypeName[i]))
src\RoslynAnalyzers\Utilities\Compiler\WordParser.cs (2)
558char c = _text[_index++]; 576char c = _text[index];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher.Lexer.cs (6)
26if (headerText[Position] == '\\') 80switch (headerText[position]) 86headerText[position] == '*') 124public readonly char CurrentCharacter => headerText[Position]; 126public char EatCurrentCharacter() => headerText[Position++]; 142public readonly char this[int position] => headerText[position];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\AbstractVirtualCharService.cs (6)
33var ch = tokenText[index]; 34var next = tokenText[index + 1]; 165if (tokenText[index] == '"' && tokenText[index + 1] == '"') 171else if (escapeBraces && IsOpenOrCloseBrace(tokenText[index])) 176result.Add(VirtualChar.Create(new Rune(tokenText[index]), span));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\AbstractVirtualCharService.ITextInfo.cs (1)
29public readonly char Get(string text, int index) => text[index];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\VirtualCharSequence.Chunks.cs (3)
102if (char.IsHighSurrogate(data[index])) 105!char.IsLowSurrogate(data[index + 1])); 110var ch = data[index];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\StringExtensions.cs (8)
20if (!char.IsWhiteSpace(line[i])) 35if (!char.IsWhiteSpace(line[i])) 87if (textSnippet[i] == '\t') 109if (predicate(text[i])) 158if (text[i] == '\n') 162else if (text[i] == '\r') 164if (i + 1 == text.Length || text[i + 1] != '\n') 230if (line[i] == '\t')
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\FormattingExtensions.cs (3)
228if (text[i] is not ' ' and not '\t') 245if (i >= newText.Length || text[i] != newText[i])
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\TriviaEngine\AbstractTriviaFormatter.cs (5)
147if (!IsWhitespace(text[i]) || !IsNewLine(text[i])) 503if (!char.IsWhiteSpace(this.OriginalString[i])) 533if (!IsWhitespace(this.OriginalString[i])) 743if (this.OriginalString[i] == '\n')
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.cs (11)
180private static readonly Func<string, TextSpan, bool> s_firstCharIsLowerCase = (val, span) => !DoesCharacterHaveCasing(val[span.Start]) || char.IsLower(val[span.Start]); 181private static readonly Func<string, TextSpan, bool> s_firstCharIsUpperCase = (val, span) => !DoesCharacterHaveCasing(val[span.Start]) || char.IsUpper(val[span.Start]); 187if (DoesCharacterHaveCasing(val[i]) && !char.IsUpper(val[i])) 200if (DoesCharacterHaveCasing(val[i]) && !char.IsLower(val[i])) 348switch (char.ToLowerInvariant(name[index])) 353if (index + 2 < name.Length && name[index + 1] == '_') 362if (index + 1 < name.Length && !char.IsDigit(name[index + 1]))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\ISyntaxFactsExtensions.cs (1)
263if (!syntaxFacts.IsIdentifierPartCharacter(name[i]))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (16)
65Debug.Assert(Data[Position] == c); 87Debug.Assert(char.IsNumber(Data[Position])); 92while (char.IsNumber(Data[Position])) 94var digit = Data[Position] - '0'; 139if ((SymbolKeyType)Data[Position] == SymbolKeyType.Null) 152if (Data[Position] != DoubleQuoteChar) 160if (Data[Position + 1] == DoubleQuoteChar) 202Debug.Assert((SymbolKeyType)Data[Position] != SymbolKeyType.Null); 261var ch = Data[Position]; 266var type = (SymbolKeyType)Data[Position]; 272else if (Data[Position] == DoubleQuoteChar) 306_builder.Append(Data[i]); 474var type = (SymbolKeyType)Data[Position]; 485type = (SymbolKeyType)Data[Position]; 547Debug.Assert((SymbolKeyType)Data[Position] != SymbolKeyType.Null); 646if ((SymbolKeyType)Data[Position] == SymbolKeyType.Null)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\Base64Utilities.cs (1)
338while (index >= 0 && attributeData[index] == '=')
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BKTree.cs (1)
79lowerCaseCharacters[i] = CaseInsensitiveComparison.ToLower(value[i]);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EditDistance.cs (2)
62array[i] = CaseInsensitiveComparison.ToLower(text[i]); 94targetLowerCaseCharacters[i] = CaseInsensitiveComparison.ToLower(target[i]);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\StringBreaker.cs (9)
46var firstChar = identifier[wordStart]; 86var c = identifier[current]; 108var c = identifier[current]; 118while (current < length && char.IsUpper(identifier[current])) 123if (current < length && IsLower(identifier[current])) 126Debug.Assert(char.IsUpper(identifier[current - 1])); 153while (current < length && IsLower(identifier[current])) 164while (current < length && char.IsDigit(identifier[current])) 176var ch = identifier[wordStart];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\StringEscapeEncoder.cs (2)
46builder.AppendFormat("{0:X2}", (int)text[index]); 105var ch = text[i];
Microsoft.CodeAnalysis.BannedApiAnalyzers (114)
DocumentationCommentIdParser.cs (2)
82=> index >= id.Length ? '\0' : id[index]; 105while (index < id.Length && char.IsDigit(id[index]))
src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (12)
53while (lastSeparator > 0 && IsDirectorySeparator(s[lastSeparator - 1])) 71if (s.Length == 0 || IsAnyDirectorySeparator(s[s.Length - 1])) 145if (IsDirectorySeparator(path[i])) 147if (i > 0 && IsDirectorySeparator(path[i - 1])) 240if (!IsDirectorySeparator(path[i])) 276while (i < length && IsDirectorySeparator(path[i])) 440char c = root[root.Length - 1]; 479if (path.Length > 0 && IsDirectorySeparator(path[path.Length - 1])) 611&& (IsDirectorySeparator(parentPath[parentPath.Length - 1]) || IsDirectorySeparator(childPath[parentPath.Length])); 663if (!PathCharEqual(path1[i], path2[i]))
src\Compilers\Core\Portable\InternalUtilities\FileNameUtilities.cs (2)
122if (path.Length > 0 && path[path.Length - 1] == '.') 175char ch = path[i];
src\Compilers\Core\Portable\InternalUtilities\StringExtensions.cs (7)
173char c = str[i++]; 178if (i < str.Length && char.IsLowSurrogate(str[i])) 208if (arg.Length > 1 && arg[0] == '"' && arg[arg.Length - 1] == '"') 224char.ToUpper(string1[x]) == char.ToUpper(string2[x])) 236string1[x] == string2[x])
src\Compilers\Core\Portable\InternalUtilities\StringTable.cs (4)
489if (array[i] != text[start + i]) 519if (array[i] != text[i]) 545if (ascii[i] != text[i])
src\Compilers\Core\Portable\InternalUtilities\UnicodeCharacterUtilities.cs (1)
106if (!IsIdentifierPartCharacter(name[i]))
src\Compilers\Core\Portable\Syntax\SyntaxTreeExtensions.cs (4)
65found = fromNode[index]; 66expected = fromText[index]; 100if (s1[i] != s2[i])
src\RoslynAnalyzers\Utilities\Compiler\Options\AnalyzerOptionsExtensions.cs (1)
365if (trimmedSuffix[i] != ' ')
src\RoslynAnalyzers\Utilities\Compiler\WellKnownTypeProvider.cs (2)
222if (fullTypeName[i] == '.') 227else if (!IsIdentifierPartCharacter(fullTypeName[i]))
src\RoslynAnalyzers\Utilities\Compiler\WordParser.cs (2)
558char c = _text[_index++]; 576char c = _text[index];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher.Lexer.cs (6)
26if (headerText[Position] == '\\') 80switch (headerText[position]) 86headerText[position] == '*') 124public readonly char CurrentCharacter => headerText[Position]; 126public char EatCurrentCharacter() => headerText[Position++]; 142public readonly char this[int position] => headerText[position];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\AbstractVirtualCharService.cs (6)
33var ch = tokenText[index]; 34var next = tokenText[index + 1]; 165if (tokenText[index] == '"' && tokenText[index + 1] == '"') 171else if (escapeBraces && IsOpenOrCloseBrace(tokenText[index])) 176result.Add(VirtualChar.Create(new Rune(tokenText[index]), span));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\AbstractVirtualCharService.ITextInfo.cs (1)
29public readonly char Get(string text, int index) => text[index];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\VirtualCharSequence.Chunks.cs (3)
102if (char.IsHighSurrogate(data[index])) 105!char.IsLowSurrogate(data[index + 1])); 110var ch = data[index];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\StringExtensions.cs (8)
20if (!char.IsWhiteSpace(line[i])) 35if (!char.IsWhiteSpace(line[i])) 87if (textSnippet[i] == '\t') 109if (predicate(text[i])) 158if (text[i] == '\n') 162else if (text[i] == '\r') 164if (i + 1 == text.Length || text[i + 1] != '\n') 230if (line[i] == '\t')
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\FormattingExtensions.cs (3)
228if (text[i] is not ' ' and not '\t') 245if (i >= newText.Length || text[i] != newText[i])
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\TriviaEngine\AbstractTriviaFormatter.cs (5)
147if (!IsWhitespace(text[i]) || !IsNewLine(text[i])) 503if (!char.IsWhiteSpace(this.OriginalString[i])) 533if (!IsWhitespace(this.OriginalString[i])) 743if (this.OriginalString[i] == '\n')
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.cs (11)
180private static readonly Func<string, TextSpan, bool> s_firstCharIsLowerCase = (val, span) => !DoesCharacterHaveCasing(val[span.Start]) || char.IsLower(val[span.Start]); 181private static readonly Func<string, TextSpan, bool> s_firstCharIsUpperCase = (val, span) => !DoesCharacterHaveCasing(val[span.Start]) || char.IsUpper(val[span.Start]); 187if (DoesCharacterHaveCasing(val[i]) && !char.IsUpper(val[i])) 200if (DoesCharacterHaveCasing(val[i]) && !char.IsLower(val[i])) 348switch (char.ToLowerInvariant(name[index])) 353if (index + 2 < name.Length && name[index + 1] == '_') 362if (index + 1 < name.Length && !char.IsDigit(name[index + 1]))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\ISyntaxFactsExtensions.cs (1)
263if (!syntaxFacts.IsIdentifierPartCharacter(name[i]))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (16)
65Debug.Assert(Data[Position] == c); 87Debug.Assert(char.IsNumber(Data[Position])); 92while (char.IsNumber(Data[Position])) 94var digit = Data[Position] - '0'; 139if ((SymbolKeyType)Data[Position] == SymbolKeyType.Null) 152if (Data[Position] != DoubleQuoteChar) 160if (Data[Position + 1] == DoubleQuoteChar) 202Debug.Assert((SymbolKeyType)Data[Position] != SymbolKeyType.Null); 261var ch = Data[Position]; 266var type = (SymbolKeyType)Data[Position]; 272else if (Data[Position] == DoubleQuoteChar) 306_builder.Append(Data[i]); 474var type = (SymbolKeyType)Data[Position]; 485type = (SymbolKeyType)Data[Position]; 547Debug.Assert((SymbolKeyType)Data[Position] != SymbolKeyType.Null); 646if ((SymbolKeyType)Data[Position] == SymbolKeyType.Null)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\Base64Utilities.cs (1)
338while (index >= 0 && attributeData[index] == '=')
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BKTree.cs (1)
79lowerCaseCharacters[i] = CaseInsensitiveComparison.ToLower(value[i]);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EditDistance.cs (2)
62array[i] = CaseInsensitiveComparison.ToLower(text[i]); 94targetLowerCaseCharacters[i] = CaseInsensitiveComparison.ToLower(target[i]);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\StringBreaker.cs (9)
46var firstChar = identifier[wordStart]; 86var c = identifier[current]; 108var c = identifier[current]; 118while (current < length && char.IsUpper(identifier[current])) 123if (current < length && IsLower(identifier[current])) 126Debug.Assert(char.IsUpper(identifier[current - 1])); 153while (current < length && IsLower(identifier[current])) 164while (current < length && char.IsDigit(identifier[current])) 176var ch = identifier[wordStart];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\StringEscapeEncoder.cs (2)
46builder.AppendFormat("{0:X2}", (int)text[index]); 105var ch = text[i];
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (1)
373if (p.Length > 0 && char.IsLetter(name[p.Start]))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\TypeInferenceService\AbstractTypeInferenceService.cs (1)
72var nextChar = name[prefix.Length];
Microsoft.CodeAnalysis.CodeStyle (109)
src\Compilers\Core\Portable\DiagnosticAnalyzer\SuppressMessageAttributeState.TargetSymbolResolver.cs (4)
289return _index >= _name.Length ? '\0' : _name[_index]; 296while (_index < _name.Length && char.IsDigit(_name[_index])) 298n = n * 10 + (_name[_index] - '0'); 456for (; _index < _name.Length && _name[_index] != '}'; ++_index) { }
src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (12)
53while (lastSeparator > 0 && IsDirectorySeparator(s[lastSeparator - 1])) 71if (s.Length == 0 || IsAnyDirectorySeparator(s[s.Length - 1])) 145if (IsDirectorySeparator(path[i])) 147if (i > 0 && IsDirectorySeparator(path[i - 1])) 240if (!IsDirectorySeparator(path[i])) 276while (i < length && IsDirectorySeparator(path[i])) 440char c = root[root.Length - 1]; 479if (path.Length > 0 && IsDirectorySeparator(path[path.Length - 1])) 611&& (IsDirectorySeparator(parentPath[parentPath.Length - 1]) || IsDirectorySeparator(childPath[parentPath.Length])); 663if (!PathCharEqual(path1[i], path2[i]))
src\Compilers\Core\Portable\InternalUtilities\FileNameUtilities.cs (2)
122if (path.Length > 0 && path[path.Length - 1] == '.') 175char ch = path[i];
src\Compilers\Core\Portable\InternalUtilities\StringExtensions.cs (7)
173char c = str[i++]; 178if (i < str.Length && char.IsLowSurrogate(str[i])) 208if (arg.Length > 1 && arg[0] == '"' && arg[arg.Length - 1] == '"') 224char.ToUpper(string1[x]) == char.ToUpper(string2[x])) 236string1[x] == string2[x])
src\Compilers\Core\Portable\InternalUtilities\StringTable.cs (4)
489if (array[i] != text[start + i]) 519if (array[i] != text[i]) 545if (ascii[i] != text[i])
src\Compilers\Core\Portable\InternalUtilities\UnicodeCharacterUtilities.cs (1)
106if (!IsIdentifierPartCharacter(name[i]))
src\Compilers\Core\Portable\Syntax\SyntaxTreeExtensions.cs (4)
65found = fromNode[index]; 66expected = fromText[index]; 100if (s1[i] != s2[i])
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher.Lexer.cs (6)
26if (headerText[Position] == '\\') 80switch (headerText[position]) 86headerText[position] == '*') 124public readonly char CurrentCharacter => headerText[Position]; 126public char EatCurrentCharacter() => headerText[Position++]; 142public readonly char this[int position] => headerText[position];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\AbstractVirtualCharService.cs (6)
33var ch = tokenText[index]; 34var next = tokenText[index + 1]; 165if (tokenText[index] == '"' && tokenText[index + 1] == '"') 171else if (escapeBraces && IsOpenOrCloseBrace(tokenText[index])) 176result.Add(VirtualChar.Create(new Rune(tokenText[index]), span));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\AbstractVirtualCharService.ITextInfo.cs (1)
29public readonly char Get(string text, int index) => text[index];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\VirtualCharSequence.Chunks.cs (3)
102if (char.IsHighSurrogate(data[index])) 105!char.IsLowSurrogate(data[index + 1])); 110var ch = data[index];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\StringExtensions.cs (8)
20if (!char.IsWhiteSpace(line[i])) 35if (!char.IsWhiteSpace(line[i])) 87if (textSnippet[i] == '\t') 109if (predicate(text[i])) 158if (text[i] == '\n') 162else if (text[i] == '\r') 164if (i + 1 == text.Length || text[i + 1] != '\n') 230if (line[i] == '\t')
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\FormattingExtensions.cs (3)
228if (text[i] is not ' ' and not '\t') 245if (i >= newText.Length || text[i] != newText[i])
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\TriviaEngine\AbstractTriviaFormatter.cs (5)
147if (!IsWhitespace(text[i]) || !IsNewLine(text[i])) 503if (!char.IsWhiteSpace(this.OriginalString[i])) 533if (!IsWhitespace(this.OriginalString[i])) 743if (this.OriginalString[i] == '\n')
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.cs (11)
180private static readonly Func<string, TextSpan, bool> s_firstCharIsLowerCase = (val, span) => !DoesCharacterHaveCasing(val[span.Start]) || char.IsLower(val[span.Start]); 181private static readonly Func<string, TextSpan, bool> s_firstCharIsUpperCase = (val, span) => !DoesCharacterHaveCasing(val[span.Start]) || char.IsUpper(val[span.Start]); 187if (DoesCharacterHaveCasing(val[i]) && !char.IsUpper(val[i])) 200if (DoesCharacterHaveCasing(val[i]) && !char.IsLower(val[i])) 348switch (char.ToLowerInvariant(name[index])) 353if (index + 2 < name.Length && name[index + 1] == '_') 362if (index + 1 < name.Length && !char.IsDigit(name[index + 1]))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\ISyntaxFactsExtensions.cs (1)
263if (!syntaxFacts.IsIdentifierPartCharacter(name[i]))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (16)
65Debug.Assert(Data[Position] == c); 87Debug.Assert(char.IsNumber(Data[Position])); 92while (char.IsNumber(Data[Position])) 94var digit = Data[Position] - '0'; 139if ((SymbolKeyType)Data[Position] == SymbolKeyType.Null) 152if (Data[Position] != DoubleQuoteChar) 160if (Data[Position + 1] == DoubleQuoteChar) 202Debug.Assert((SymbolKeyType)Data[Position] != SymbolKeyType.Null); 261var ch = Data[Position]; 266var type = (SymbolKeyType)Data[Position]; 272else if (Data[Position] == DoubleQuoteChar) 306_builder.Append(Data[i]); 474var type = (SymbolKeyType)Data[Position]; 485type = (SymbolKeyType)Data[Position]; 547Debug.Assert((SymbolKeyType)Data[Position] != SymbolKeyType.Null); 646if ((SymbolKeyType)Data[Position] == SymbolKeyType.Null)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\Base64Utilities.cs (1)
338while (index >= 0 && attributeData[index] == '=')
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BKTree.cs (1)
79lowerCaseCharacters[i] = CaseInsensitiveComparison.ToLower(value[i]);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EditDistance.cs (2)
62array[i] = CaseInsensitiveComparison.ToLower(text[i]); 94targetLowerCaseCharacters[i] = CaseInsensitiveComparison.ToLower(target[i]);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\StringBreaker.cs (9)
46var firstChar = identifier[wordStart]; 86var c = identifier[current]; 108var c = identifier[current]; 118while (current < length && char.IsUpper(identifier[current])) 123if (current < length && IsLower(identifier[current])) 126Debug.Assert(char.IsUpper(identifier[current - 1])); 153while (current < length && IsLower(identifier[current])) 164while (current < length && char.IsDigit(identifier[current])) 176var ch = identifier[wordStart];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\StringEscapeEncoder.cs (2)
46builder.AppendFormat("{0:X2}", (int)text[index]); 105var ch = text[i];
Microsoft.CodeAnalysis.CodeStyle.Fixes (2)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (1)
373if (p.Length > 0 && char.IsLetter(name[p.Start]))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\TypeInferenceService\AbstractTypeInferenceService.cs (1)
72var nextChar = name[prefix.Length];
Microsoft.CodeAnalysis.CSharp (30)
Binder\Binder_InterpolatedString.cs (2)
197var c = value[i]; 201value[i + 1] == c)
BoundTree\LengthBasedStringSwitchData.cs (2)
187foreach (var group in casesWithGivenLength.GroupBy(c => c.value[bestCharacterPosition])) 235var currentChar = caseLabel.value[position];
Compilation\CSharpCompilation.cs (4)
3919var b = SyntaxFacts.HexValue(bytesText[i * 2]) * 16 + 3920SyntaxFacts.HexValue(bytesText[i * 2 + 1]); 3939var b = SyntaxFacts.HexValue(bytesText[i * 2]) * 16 + 3940SyntaxFacts.HexValue(bytesText[i * 2 + 1]);
Compiler\DocumentationCommentCompiler.cs (9)
858if (!SyntaxFacts.IsWhitespace(str[start])) 886if (prefix[i] != str[i + start]) 907switch (str[start]) 910if ((start + 1) < str.Length && str[start + 1] == '\n') 944if (trimmedLength < 4 || !SyntaxFacts.IsWhitespace(text[trimStart + 3])) 1086for (; pos < minLength && str1[pos] == str2[pos]; pos++) 1334_writer.Write(message[start + i]);
Compiler\MethodBodySynthesizer.Lowered.cs (1)
35hashCode = unchecked((text[i] ^ hashCode) * 16777619);
Parser\CharacterInfo.cs (1)
214if (UnicodeCharacterUtilities.IsFormattingChar(name[i]))
Parser\LanguageParser_InterpolatedString.cs (1)
284if (openBracePosition > 0 && SyntaxFacts.IsNewLine(originalText[openBracePosition - 1]))
Parser\SlidingTextWindow.cs (1)
402if (PeekChar(i) != desired[i])
SymbolDisplay\ObjectDisplay.cs (1)
241char c = value[i];
Symbols\Synthesized\GeneratedNameParser.cs (6)
49int c = name[closeBracketOffset + 1]; 66char opening = str[openingOffset]; 71var c = str[i]; 148if (lastUnder - 1 < 0 || lastUnder == fieldName.Length || fieldName[lastUnder - 1] != '_') 225builder[i] = (byte)((hexCharToByte(checksumString[i * 2]) << 4) | hexCharToByte(checksumString[i * 2 + 1]));
Symbols\Synthesized\GeneratedNames.cs (2)
431if (name.Length <= DelegateNamePrefixLength || name[DelegateNamePrefixLength] != '{') 450if (name[nameEndIndex + 1] != GeneratedNameConstants.GenerationSeparator)
Microsoft.CodeAnalysis.CSharp.CodeStyle (17)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\EmbeddedLanguages\VirtualChars\CSharpVirtualCharService.cs (15)
149while (tokenText[startIndexInclusive] == '"') 152Contract.ThrowIfFalse(tokenText[endIndexExclusive - 1] == '"'); 259var ch = tokenText[index]; 342Debug.Assert(tokenText[index] == '\\'); 355Debug.Assert(tokenText[index] == '\\'); 357var ch = tokenText[index + 1]; 389Debug.Assert(tokenText[index] == '\\'); 391var ch = tokenText[index + 1]; 408Debug.Assert(tokenText[index] == '\\'); 417if (!IsHexDigit(tokenText[index])) 425character = tokenText[index + i]; 469if (!IsHexDigit(tokenText[index])) 477var ch2 = tokenText[index + i]; 497if (!IsHexDigit(tokenText[index])) 506var ch2 = tokenText[index + i];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\Trivia\TriviaDataFactory.Analyzer.cs (2)
165if (text[i] == ' ') 169else if (text[i] == '\t')
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (1)
src\Analyzers\CSharp\CodeFixes\ConvertNamespace\ConvertNamespaceTransform.cs (1)
184if (indentation[commonIndentation] != text[textLine.Start + commonIndentation])
Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests (4)
CommandLineTests.cs (4)
265var lastSlash = path[lastSlashIndex]; 1881Assert.True(Array.IndexOf(acceptableSurroundingChar, actual[foundIndex - 1]) >= 0); 1882Assert.True(Array.IndexOf(acceptableSurroundingChar, actual[foundIndex + version.Length]) >= 0); 9655Assert.Equal('(', text[expectedPath.Length]);
Microsoft.CodeAnalysis.CSharp.EditorFeatures (8)
StringCopyPaste\StringCopyPasteHelpers.cs (8)
143while (start < value.Length && SyntaxFacts.IsWhitespace(value[start])) 298var ch = value[i]; 299var nextCh = i == value.Length - 1 ? 0 : value[i + 1]; 428var ch = value[i]; 429var nextCh = i == value.Length - 1 ? 0 : value[i + 1]; 457var ch = value[i]; 458var nextCh = i == value.Length - 1 ? 0 : value[i + 1]; 531if (commonIndentPrefix[commonPrefixLength] != text[lineWhitespaceSpan.Start + commonPrefixLength])
Microsoft.CodeAnalysis.CSharp.ExpressionEvaluator.ResultProvider (12)
src\Compilers\Core\Portable\InternalUtilities\UnicodeCharacterUtilities.cs (1)
106if (!IsIdentifierPartCharacter(name[i]))
src\Compilers\CSharp\Portable\Parser\CharacterInfo.cs (1)
214if (UnicodeCharacterUtilities.IsFormattingChar(name[i]))
src\Compilers\CSharp\Portable\SymbolDisplay\ObjectDisplay.cs (1)
241char c = value[i];
src\Compilers\CSharp\Portable\Symbols\Synthesized\GeneratedNameParser.cs (6)
49int c = name[closeBracketOffset + 1]; 66char opening = str[openingOffset]; 71var c = str[i]; 148if (lastUnder - 1 < 0 || lastUnder == fieldName.Length || fieldName[lastUnder - 1] != '_') 225builder[i] = (byte)((hexCharToByte(checksumString[i * 2]) << 4) | hexCharToByte(checksumString[i * 2 + 1]));
src\ExpressionEvaluator\CSharp\Source\ResultProvider\CSharpFormatter.cs (3)
88var ch = expression[i]; 91if (ch == '*' && i + 1 < length && expression[i + 1] == '/') 101var next = expression[i + 1];
Microsoft.CodeAnalysis.CSharp.Features (7)
Completion\CompletionProviders\ExplicitInterfaceMemberCompletionProvider.cs (1)
120if (memberString[i] is '(' or '[' or '<')
ConvertToRawString\ConvertInterpolatedStringToRawStringCodeRefactoringProvider.cs (3)
684while (current < length && SyntaxFacts.IsWhitespace(leadingWhitespace1[current]) && leadingWhitespace1[current] == leadingWhitespace2[current])
EditAndContinue\BreakpointSpans.cs (1)
49if (!SyntaxFacts.IsWhitespace(text[i]))
src\Analyzers\CSharp\CodeFixes\ConvertNamespace\ConvertNamespaceTransform.cs (1)
184if (indentation[commonIndentation] != text[textLine.Start + commonIndentation])
TaskList\CSharpTaskListService.cs (1)
71var ch = message[i];
Microsoft.CodeAnalysis.CSharp.Scripting.UnitTests (2)
CommandLineRunnerTests.cs (2)
777Assert.True(Array.IndexOf(acceptableSurroundingChar, actual[foundIndex - 1]) >= 0); 778Assert.True(Array.IndexOf(acceptableSurroundingChar, actual[foundIndex + version.Length]) >= 0);
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (2)
Semantics\LookupTests.cs (2)
733Assert.Equal('{', testSrc[GetPositionForBinding(testSrc)]); 784Assert.Equal('}', testSrc[GetPositionForBinding(testSrc)]);
Microsoft.CodeAnalysis.CSharp.Workspaces (18)
Classification\Worker_DocumentationComments.cs (1)
105var ch = text[index];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\EmbeddedLanguages\VirtualChars\CSharpVirtualCharService.cs (15)
149while (tokenText[startIndexInclusive] == '"') 152Contract.ThrowIfFalse(tokenText[endIndexExclusive - 1] == '"'); 259var ch = tokenText[index]; 342Debug.Assert(tokenText[index] == '\\'); 355Debug.Assert(tokenText[index] == '\\'); 357var ch = tokenText[index + 1]; 389Debug.Assert(tokenText[index] == '\\'); 391var ch = tokenText[index + 1]; 408Debug.Assert(tokenText[index] == '\\'); 417if (!IsHexDigit(tokenText[index])) 425character = tokenText[index + i]; 469if (!IsHexDigit(tokenText[index])) 477var ch2 = tokenText[index + i]; 497if (!IsHexDigit(tokenText[index])) 506var ch2 = tokenText[index + i];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\Trivia\TriviaDataFactory.Analyzer.cs (2)
165if (text[i] == ' ') 169else if (text[i] == '\t')
Microsoft.CodeAnalysis.Debugging.Package (6)
CustomDebugInfoReader.cs (6)
700switch (import[pos]) 730switch (import[pos]) 747switch (import[pos]) 752if (import[pos] != ':') 770if (import[pos] != ':') 788if (import[pos] != ':')
Microsoft.CodeAnalysis.EditorFeatures (3)
Interactive\InteractiveWindowResetCommand.cs (2)
102if ((index == 0 || char.IsWhiteSpace(arguments[index - 1])) && 103(index + s_noConfigParameterNameLength == arguments.Length || char.IsWhiteSpace(arguments[index + s_noConfigParameterNameLength])))
SplitComment\SplitCommentCommandHandler.cs (1)
127if (snapshot[position + c] != commentStart[c])
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (5)
BraceHighlighting\MultiCharacterBraceHighlightingTests.cs (5)
50var ch = text[position]; 57Debug.Assert(text[position + 1] == '@'); 65if (text[position - 1] == '<') 72Debug.Assert(text[position + 1] == '>'); 81Debug.Assert(text[position - 1] == '@');
Microsoft.CodeAnalysis.EditorFeatures.Text (1)
Shared\Extensions\ITextSnapshotLineExtensions.cs (1)
131var expectedCharacter = value[i];
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (2)
MetadataAsSource\AbstractMetadataAsSourceTests.TestContext.cs (1)
201while (lastDotIndex > 0 && symbolMetadataName[lastDotIndex - 1] == '.')
Utilities\BloomFilterTests.cs (1)
36var c = Alphabet[v];
Microsoft.CodeAnalysis.ExpressionEvaluator.FunctionResolver (18)
CSharp\Scanner.cs (6)
89while (_offset < length && char.IsWhiteSpace(_text[_offset])) 99var c = _text[_offset++]; 104else if (c == '@' && _offset < length && UnicodeCharacterUtilities.IsIdentifierStartCharacter(_text[_offset])) 117Debug.Assert(UnicodeCharacterUtilities.IsIdentifierStartCharacter(_text[_offset - 1])); 118Debug.Assert(_offset == 1 || !UnicodeCharacterUtilities.IsIdentifierPartCharacter(_text[_offset - 2])); 122while ((_offset < length) && UnicodeCharacterUtilities.IsIdentifierPartCharacter(_text[_offset]))
src\Compilers\Core\Portable\InternalUtilities\UnicodeCharacterUtilities.cs (1)
106if (!IsIdentifierPartCharacter(name[i]))
src\Compilers\CSharp\Portable\Symbols\Synthesized\GeneratedNameParser.cs (6)
49int c = name[closeBracketOffset + 1]; 66char opening = str[openingOffset]; 71var c = str[i]; 148if (lastUnder - 1 < 0 || lastUnder == fieldName.Length || fieldName[lastUnder - 1] != '_') 225builder[i] = (byte)((hexCharToByte(checksumString[i * 2]) << 4) | hexCharToByte(checksumString[i * 2 + 1]));
VisualBasic\Scanner.cs (5)
84while (_offset < length && char.IsWhiteSpace(_text[_offset])) 108var c = _text[_offset++]; 112if (n > 0 && _offset + n < length && _text[_offset + n] == ']') 130if (length > 0 && UnicodeCharacterUtilities.IsIdentifierStartCharacter(_text[_offset])) 133while (n < length && UnicodeCharacterUtilities.IsIdentifierPartCharacter(_text[_offset + n]))
Microsoft.CodeAnalysis.ExpressionEvaluator.ResultProvider (21)
src\Compilers\Core\Portable\CaseInsensitiveComparison.cs (9)
114int ordDiff = CompareLowerUnicode(str1[i], str2[i]); 165if (!AreEqualLowerUnicode(str1[i], str2[i])) 214if (!AreEqualLowerUnicode(value[i], possibleEnd[j])) 245if (!AreEqualLowerUnicode(value[i], possibleStart[i])) 260hashCode = Hash.CombineFNVHash(hashCode, ToLower(str[i]));
src\Compilers\Core\Portable\Xml\XmlCharType.cs (7)
993return (s_PublicIdBitmap[ch >> 4] & (1 << (ch & 0xF))) != 0; 1092if ((GetCharProperties(str[i]) & fWhitespace) == 0) 1107if ((GetCharProperties(str[i]) & fCharData) == 0) 1109if (i + 1 >= str.Length || !(XmlCharType.IsHighSurrogate(str[i]) && XmlCharType.IsLowSurrogate(str[i + 1]))) 1131if (!IsDigit(str[i])) 1161if (!IsPubidChar(str[i]))
src\ExpressionEvaluator\Core\Source\ResultProvider\Formatter.cs (5)
229var ch = expr[i]; 273return (index > 0) && (expr[index - 1] == ')'); 295for (; start < oldLength && leading(expression[start]); start++) 298for (; length > start && trailing(expression[length - 1]); length--) 320var ch = expression[i];
Microsoft.CodeAnalysis.ExpressionEvaluator.ResultProvider.Utilities (6)
Debugger\Engine\DkmClrValue.cs (1)
252char ch = formatString[i];
src\ExpressionEvaluator\Core\Source\ResultProvider\Formatter.cs (5)
229var ch = expr[i]; 273return (index > 0) && (expr[index - 1] == ')'); 295for (; start < oldLength && leading(expression[start]); start++) 298for (; length > start && trailing(expression[length - 1]); length--) 320var ch = expression[i];
Microsoft.CodeAnalysis.Extensions.Package (7)
src\Compilers\Core\Portable\InternalUtilities\StringExtensions.cs (7)
173char c = str[i++]; 178if (i < str.Length && char.IsLowSurrogate(str[i])) 208if (arg.Length > 1 && arg[0] == '"' && arg[arg.Length - 1] == '"') 224char.ToUpper(string1[x]) == char.ToUpper(string2[x])) 236string1[x] == string2[x])
Microsoft.CodeAnalysis.Features (28)
Completion\CommonCompletionUtilities.cs (1)
199if (text[characterPosition] != value[i])
Completion\Providers\SymbolCompletionItem.cs (1)
255if (projectIds[current] == ProjectSeperatorChar)
ConvertToInterpolatedString\AbstractConvertPlaceholderToInterpolatedStringRefactoringProvider.cs (3)
233if (stringLiteralText[currentLocation + 1] is >= '0' and <= '9') 239while (lookbackLocation > 0 && char.IsWhiteSpace(stringLiteralText[lookbackLocation])) 242if (stringLiteralText[lookbackLocation] != '{')
DocumentationComments\AbstractDocumentationCommentFormattingService.cs (2)
564if (char.IsWhiteSpace(rawText[i])) 590builder.Append(rawText[i]);
EditAndContinue\EditAndContinueDiagnosticDescriptors.cs (1)
243=> diagnosticId.Length > EncDiagnosticIdPrefix.Length && diagnosticId.StartsWith(EncDiagnosticIdPrefix, StringComparison.Ordinal) && diagnosticId[EncDiagnosticIdPrefix.Length] is >= '0' and <= '9';
EmbeddedLanguages\Json\JsonLexer.cs (1)
326if (position + i >= Text.Length || Text[position + i] != val[i])
EmbeddedLanguages\Json\JsonParser.cs (1)
536if (chars[i] != val[i])
EmbeddedLanguages\RegularExpressions\RegexLexer.cs (1)
187Text[position + i] != val[i])
EmbeddedLanguages\StackFrame\StackFrameLexer.cs (1)
445Text[position + i] != val[i])
InlineHints\AbstractInlineParameterNameHintsService.cs (1)
262char.IsUpper(nameValue[prefix.Length]))
ReplaceMethodWithProperty\ReplaceMethodWithPropertyCodeRefactoringProvider.cs (1)
94=> text.StartsWith(prefix, StringComparison.OrdinalIgnoreCase) && text.Length > prefix.Length && !char.IsLower(text[prefix.Length]);
Snippets\RoslynLSPSnippetConverter.cs (1)
67lspSnippetString.Append(textChangeText[i]);
src\Compilers\Core\Portable\DiagnosticAnalyzer\SuppressMessageAttributeState.TargetSymbolResolver.cs (4)
289return _index >= _name.Length ? '\0' : _name[_index]; 296while (_index < _name.Length && char.IsDigit(_name[_index])) 298n = n * 10 + (_name[_index] - '0'); 456for (; _index < _name.Length && _name[_index] != '}'; ++_index) { }
src\Dependencies\CodeAnalysis.Debugging\CustomDebugInfoReader.cs (6)
700switch (import[pos]) 730switch (import[pos]) 747switch (import[pos]) 752if (import[pos] != ':') 770if (import[pos] != ':') 788if (import[pos] != ':')
TaskList\AbstractTaskListService.cs (1)
101if (message.Length > index + token.Length && IsIdentifierCharacter(message[index + token.Length]))
Workspace\CompileTimeSolutionProvider.cs (2)
155switch (filePath[i]) 162builder.Append(filePath[i]);
Microsoft.CodeAnalysis.InteractiveHost (14)
src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (12)
53while (lastSeparator > 0 && IsDirectorySeparator(s[lastSeparator - 1])) 71if (s.Length == 0 || IsAnyDirectorySeparator(s[s.Length - 1])) 145if (IsDirectorySeparator(path[i])) 147if (i > 0 && IsDirectorySeparator(path[i - 1])) 240if (!IsDirectorySeparator(path[i])) 276while (i < length && IsDirectorySeparator(path[i])) 440char c = root[root.Length - 1]; 479if (path.Length > 0 && IsDirectorySeparator(path[path.Length - 1])) 611&& (IsDirectorySeparator(parentPath[parentPath.Length - 1]) || IsDirectorySeparator(childPath[parentPath.Length])); 663if (!PathCharEqual(path1[i], path2[i]))
src\Compilers\Core\Portable\InternalUtilities\FileNameUtilities.cs (2)
122if (path.Length > 0 && path[path.Length - 1] == '.') 175char ch = path[i];
Microsoft.CodeAnalysis.LanguageServer (1)
HostWorkspace\ProjectTelemetry\VsTfmAndFileExtHashingAlgorithm.cs (1)
63lHash = (s_cr3tab[((int)lHash ^ cleartext[i]) & 0xff] ^ ((lHash >> 8) & 0x00FFFFFFL));
Microsoft.CodeAnalysis.LanguageServer.Protocol (3)
Extensions\ProtocolConversions.cs (1)
284if (!IsAscii(filePath[i]))
Handler\InlineCompletions\XmlSnippetParser.CodeSnippet.cs (2)
193if (string.Equals(_code[currentCharIndex].ToString(CultureInfo.CurrentCulture), _delimiter, StringComparison.Ordinal)) 214if (string.Equals(_code[currentCharIndex].ToString(CultureInfo.CurrentCulture), _delimiter, StringComparison.Ordinal))
Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers (112)
src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (12)
53while (lastSeparator > 0 && IsDirectorySeparator(s[lastSeparator - 1])) 71if (s.Length == 0 || IsAnyDirectorySeparator(s[s.Length - 1])) 145if (IsDirectorySeparator(path[i])) 147if (i > 0 && IsDirectorySeparator(path[i - 1])) 240if (!IsDirectorySeparator(path[i])) 276while (i < length && IsDirectorySeparator(path[i])) 440char c = root[root.Length - 1]; 479if (path.Length > 0 && IsDirectorySeparator(path[path.Length - 1])) 611&& (IsDirectorySeparator(parentPath[parentPath.Length - 1]) || IsDirectorySeparator(childPath[parentPath.Length])); 663if (!PathCharEqual(path1[i], path2[i]))
src\Compilers\Core\Portable\InternalUtilities\FileNameUtilities.cs (2)
122if (path.Length > 0 && path[path.Length - 1] == '.') 175char ch = path[i];
src\Compilers\Core\Portable\InternalUtilities\StringExtensions.cs (7)
173char c = str[i++]; 178if (i < str.Length && char.IsLowSurrogate(str[i])) 208if (arg.Length > 1 && arg[0] == '"' && arg[arg.Length - 1] == '"') 224char.ToUpper(string1[x]) == char.ToUpper(string2[x])) 236string1[x] == string2[x])
src\Compilers\Core\Portable\InternalUtilities\StringTable.cs (4)
489if (array[i] != text[start + i]) 519if (array[i] != text[i]) 545if (ascii[i] != text[i])
src\Compilers\Core\Portable\InternalUtilities\UnicodeCharacterUtilities.cs (1)
106if (!IsIdentifierPartCharacter(name[i]))
src\Compilers\Core\Portable\Syntax\SyntaxTreeExtensions.cs (4)
65found = fromNode[index]; 66expected = fromText[index]; 100if (s1[i] != s2[i])
src\RoslynAnalyzers\Utilities\Compiler\Options\AnalyzerOptionsExtensions.cs (1)
365if (trimmedSuffix[i] != ' ')
src\RoslynAnalyzers\Utilities\Compiler\WellKnownTypeProvider.cs (2)
222if (fullTypeName[i] == '.') 227else if (!IsIdentifierPartCharacter(fullTypeName[i]))
src\RoslynAnalyzers\Utilities\Compiler\WordParser.cs (2)
558char c = _text[_index++]; 576char c = _text[index];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher.Lexer.cs (6)
26if (headerText[Position] == '\\') 80switch (headerText[position]) 86headerText[position] == '*') 124public readonly char CurrentCharacter => headerText[Position]; 126public char EatCurrentCharacter() => headerText[Position++]; 142public readonly char this[int position] => headerText[position];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\AbstractVirtualCharService.cs (6)
33var ch = tokenText[index]; 34var next = tokenText[index + 1]; 165if (tokenText[index] == '"' && tokenText[index + 1] == '"') 171else if (escapeBraces && IsOpenOrCloseBrace(tokenText[index])) 176result.Add(VirtualChar.Create(new Rune(tokenText[index]), span));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\AbstractVirtualCharService.ITextInfo.cs (1)
29public readonly char Get(string text, int index) => text[index];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\VirtualCharSequence.Chunks.cs (3)
102if (char.IsHighSurrogate(data[index])) 105!char.IsLowSurrogate(data[index + 1])); 110var ch = data[index];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\StringExtensions.cs (8)
20if (!char.IsWhiteSpace(line[i])) 35if (!char.IsWhiteSpace(line[i])) 87if (textSnippet[i] == '\t') 109if (predicate(text[i])) 158if (text[i] == '\n') 162else if (text[i] == '\r') 164if (i + 1 == text.Length || text[i + 1] != '\n') 230if (line[i] == '\t')
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\FormattingExtensions.cs (3)
228if (text[i] is not ' ' and not '\t') 245if (i >= newText.Length || text[i] != newText[i])
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\TriviaEngine\AbstractTriviaFormatter.cs (5)
147if (!IsWhitespace(text[i]) || !IsNewLine(text[i])) 503if (!char.IsWhiteSpace(this.OriginalString[i])) 533if (!IsWhitespace(this.OriginalString[i])) 743if (this.OriginalString[i] == '\n')
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.cs (11)
180private static readonly Func<string, TextSpan, bool> s_firstCharIsLowerCase = (val, span) => !DoesCharacterHaveCasing(val[span.Start]) || char.IsLower(val[span.Start]); 181private static readonly Func<string, TextSpan, bool> s_firstCharIsUpperCase = (val, span) => !DoesCharacterHaveCasing(val[span.Start]) || char.IsUpper(val[span.Start]); 187if (DoesCharacterHaveCasing(val[i]) && !char.IsUpper(val[i])) 200if (DoesCharacterHaveCasing(val[i]) && !char.IsLower(val[i])) 348switch (char.ToLowerInvariant(name[index])) 353if (index + 2 < name.Length && name[index + 1] == '_') 362if (index + 1 < name.Length && !char.IsDigit(name[index + 1]))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\ISyntaxFactsExtensions.cs (1)
263if (!syntaxFacts.IsIdentifierPartCharacter(name[i]))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (16)
65Debug.Assert(Data[Position] == c); 87Debug.Assert(char.IsNumber(Data[Position])); 92while (char.IsNumber(Data[Position])) 94var digit = Data[Position] - '0'; 139if ((SymbolKeyType)Data[Position] == SymbolKeyType.Null) 152if (Data[Position] != DoubleQuoteChar) 160if (Data[Position + 1] == DoubleQuoteChar) 202Debug.Assert((SymbolKeyType)Data[Position] != SymbolKeyType.Null); 261var ch = Data[Position]; 266var type = (SymbolKeyType)Data[Position]; 272else if (Data[Position] == DoubleQuoteChar) 306_builder.Append(Data[i]); 474var type = (SymbolKeyType)Data[Position]; 485type = (SymbolKeyType)Data[Position]; 547Debug.Assert((SymbolKeyType)Data[Position] != SymbolKeyType.Null); 646if ((SymbolKeyType)Data[Position] == SymbolKeyType.Null)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\Base64Utilities.cs (1)
338while (index >= 0 && attributeData[index] == '=')
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BKTree.cs (1)
79lowerCaseCharacters[i] = CaseInsensitiveComparison.ToLower(value[i]);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EditDistance.cs (2)
62array[i] = CaseInsensitiveComparison.ToLower(text[i]); 94targetLowerCaseCharacters[i] = CaseInsensitiveComparison.ToLower(target[i]);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\StringBreaker.cs (9)
46var firstChar = identifier[wordStart]; 86var c = identifier[current]; 108var c = identifier[current]; 118while (current < length && char.IsUpper(identifier[current])) 123if (current < length && IsLower(identifier[current])) 126Debug.Assert(char.IsUpper(identifier[current - 1])); 153while (current < length && IsLower(identifier[current])) 164while (current < length && char.IsDigit(identifier[current])) 176var ch = identifier[wordStart];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\StringEscapeEncoder.cs (2)
46builder.AppendFormat("{0:X2}", (int)text[index]); 105var ch = text[i];
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (1)
373if (p.Length > 0 && char.IsLetter(name[p.Start]))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\TypeInferenceService\AbstractTypeInferenceService.cs (1)
72var nextChar = name[prefix.Length];
Microsoft.CodeAnalysis.PublicApiAnalyzers (111)
DeclarePublicApiAnalyzer.Impl.cs (1)
690return index == 0 || (index > 0 && apiLineText[index - 1] == ' ');
src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (12)
53while (lastSeparator > 0 && IsDirectorySeparator(s[lastSeparator - 1])) 71if (s.Length == 0 || IsAnyDirectorySeparator(s[s.Length - 1])) 145if (IsDirectorySeparator(path[i])) 147if (i > 0 && IsDirectorySeparator(path[i - 1])) 240if (!IsDirectorySeparator(path[i])) 276while (i < length && IsDirectorySeparator(path[i])) 440char c = root[root.Length - 1]; 479if (path.Length > 0 && IsDirectorySeparator(path[path.Length - 1])) 611&& (IsDirectorySeparator(parentPath[parentPath.Length - 1]) || IsDirectorySeparator(childPath[parentPath.Length])); 663if (!PathCharEqual(path1[i], path2[i]))
src\Compilers\Core\Portable\InternalUtilities\FileNameUtilities.cs (2)
122if (path.Length > 0 && path[path.Length - 1] == '.') 175char ch = path[i];
src\Compilers\Core\Portable\InternalUtilities\StringExtensions.cs (7)
173char c = str[i++]; 178if (i < str.Length && char.IsLowSurrogate(str[i])) 208if (arg.Length > 1 && arg[0] == '"' && arg[arg.Length - 1] == '"') 224char.ToUpper(string1[x]) == char.ToUpper(string2[x])) 236string1[x] == string2[x])
src\Compilers\Core\Portable\InternalUtilities\StringTable.cs (4)
489if (array[i] != text[start + i]) 519if (array[i] != text[i]) 545if (ascii[i] != text[i])
src\Compilers\Core\Portable\InternalUtilities\UnicodeCharacterUtilities.cs (1)
106if (!IsIdentifierPartCharacter(name[i]))
src\Compilers\Core\Portable\Syntax\SyntaxTreeExtensions.cs (4)
65found = fromNode[index]; 66expected = fromText[index]; 100if (s1[i] != s2[i])
src\RoslynAnalyzers\Utilities\Compiler\Options\AnalyzerOptionsExtensions.cs (1)
365if (trimmedSuffix[i] != ' ')
src\RoslynAnalyzers\Utilities\Compiler\WellKnownTypeProvider.cs (2)
222if (fullTypeName[i] == '.') 227else if (!IsIdentifierPartCharacter(fullTypeName[i]))
src\RoslynAnalyzers\Utilities\Compiler\WordParser.cs (2)
558char c = _text[_index++]; 576char c = _text[index];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher.Lexer.cs (6)
26if (headerText[Position] == '\\') 80switch (headerText[position]) 86headerText[position] == '*') 124public readonly char CurrentCharacter => headerText[Position]; 126public char EatCurrentCharacter() => headerText[Position++]; 142public readonly char this[int position] => headerText[position];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\AbstractVirtualCharService.cs (6)
33var ch = tokenText[index]; 34var next = tokenText[index + 1]; 165if (tokenText[index] == '"' && tokenText[index + 1] == '"') 171else if (escapeBraces && IsOpenOrCloseBrace(tokenText[index])) 176result.Add(VirtualChar.Create(new Rune(tokenText[index]), span));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\AbstractVirtualCharService.ITextInfo.cs (1)
29public readonly char Get(string text, int index) => text[index];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\VirtualCharSequence.Chunks.cs (3)
102if (char.IsHighSurrogate(data[index])) 105!char.IsLowSurrogate(data[index + 1])); 110var ch = data[index];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\StringExtensions.cs (8)
20if (!char.IsWhiteSpace(line[i])) 35if (!char.IsWhiteSpace(line[i])) 87if (textSnippet[i] == '\t') 109if (predicate(text[i])) 158if (text[i] == '\n') 162else if (text[i] == '\r') 164if (i + 1 == text.Length || text[i + 1] != '\n') 230if (line[i] == '\t')
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\FormattingExtensions.cs (3)
228if (text[i] is not ' ' and not '\t') 245if (i >= newText.Length || text[i] != newText[i])
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\TriviaEngine\AbstractTriviaFormatter.cs (5)
147if (!IsWhitespace(text[i]) || !IsNewLine(text[i])) 503if (!char.IsWhiteSpace(this.OriginalString[i])) 533if (!IsWhitespace(this.OriginalString[i])) 743if (this.OriginalString[i] == '\n')
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.cs (11)
180private static readonly Func<string, TextSpan, bool> s_firstCharIsLowerCase = (val, span) => !DoesCharacterHaveCasing(val[span.Start]) || char.IsLower(val[span.Start]); 181private static readonly Func<string, TextSpan, bool> s_firstCharIsUpperCase = (val, span) => !DoesCharacterHaveCasing(val[span.Start]) || char.IsUpper(val[span.Start]); 187if (DoesCharacterHaveCasing(val[i]) && !char.IsUpper(val[i])) 200if (DoesCharacterHaveCasing(val[i]) && !char.IsLower(val[i])) 348switch (char.ToLowerInvariant(name[index])) 353if (index + 2 < name.Length && name[index + 1] == '_') 362if (index + 1 < name.Length && !char.IsDigit(name[index + 1]))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\ISyntaxFactsExtensions.cs (1)
263if (!syntaxFacts.IsIdentifierPartCharacter(name[i]))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (16)
65Debug.Assert(Data[Position] == c); 87Debug.Assert(char.IsNumber(Data[Position])); 92while (char.IsNumber(Data[Position])) 94var digit = Data[Position] - '0'; 139if ((SymbolKeyType)Data[Position] == SymbolKeyType.Null) 152if (Data[Position] != DoubleQuoteChar) 160if (Data[Position + 1] == DoubleQuoteChar) 202Debug.Assert((SymbolKeyType)Data[Position] != SymbolKeyType.Null); 261var ch = Data[Position]; 266var type = (SymbolKeyType)Data[Position]; 272else if (Data[Position] == DoubleQuoteChar) 306_builder.Append(Data[i]); 474var type = (SymbolKeyType)Data[Position]; 485type = (SymbolKeyType)Data[Position]; 547Debug.Assert((SymbolKeyType)Data[Position] != SymbolKeyType.Null); 646if ((SymbolKeyType)Data[Position] == SymbolKeyType.Null)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\Base64Utilities.cs (1)
338while (index >= 0 && attributeData[index] == '=')
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BKTree.cs (1)
79lowerCaseCharacters[i] = CaseInsensitiveComparison.ToLower(value[i]);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EditDistance.cs (2)
62array[i] = CaseInsensitiveComparison.ToLower(text[i]); 94targetLowerCaseCharacters[i] = CaseInsensitiveComparison.ToLower(target[i]);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\StringBreaker.cs (9)
46var firstChar = identifier[wordStart]; 86var c = identifier[current]; 108var c = identifier[current]; 118while (current < length && char.IsUpper(identifier[current])) 123if (current < length && IsLower(identifier[current])) 126Debug.Assert(char.IsUpper(identifier[current - 1])); 153while (current < length && IsLower(identifier[current])) 164while (current < length && char.IsDigit(identifier[current])) 176var ch = identifier[wordStart];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\StringEscapeEncoder.cs (2)
46builder.AppendFormat("{0:X2}", (int)text[index]); 105var ch = text[i];
Microsoft.CodeAnalysis.ResxSourceGenerator (112)
AbstractResxGenerator.cs (2)
805if (original[i] == '\"') 810stringLiteral.Append(original[i]);
src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (12)
53while (lastSeparator > 0 && IsDirectorySeparator(s[lastSeparator - 1])) 71if (s.Length == 0 || IsAnyDirectorySeparator(s[s.Length - 1])) 145if (IsDirectorySeparator(path[i])) 147if (i > 0 && IsDirectorySeparator(path[i - 1])) 240if (!IsDirectorySeparator(path[i])) 276while (i < length && IsDirectorySeparator(path[i])) 440char c = root[root.Length - 1]; 479if (path.Length > 0 && IsDirectorySeparator(path[path.Length - 1])) 611&& (IsDirectorySeparator(parentPath[parentPath.Length - 1]) || IsDirectorySeparator(childPath[parentPath.Length])); 663if (!PathCharEqual(path1[i], path2[i]))
src\Compilers\Core\Portable\InternalUtilities\FileNameUtilities.cs (2)
122if (path.Length > 0 && path[path.Length - 1] == '.') 175char ch = path[i];
src\Compilers\Core\Portable\InternalUtilities\StringExtensions.cs (7)
173char c = str[i++]; 178if (i < str.Length && char.IsLowSurrogate(str[i])) 208if (arg.Length > 1 && arg[0] == '"' && arg[arg.Length - 1] == '"') 224char.ToUpper(string1[x]) == char.ToUpper(string2[x])) 236string1[x] == string2[x])
src\Compilers\Core\Portable\InternalUtilities\StringTable.cs (4)
489if (array[i] != text[start + i]) 519if (array[i] != text[i]) 545if (ascii[i] != text[i])
src\Compilers\Core\Portable\InternalUtilities\UnicodeCharacterUtilities.cs (1)
106if (!IsIdentifierPartCharacter(name[i]))
src\Compilers\Core\Portable\Syntax\SyntaxTreeExtensions.cs (4)
65found = fromNode[index]; 66expected = fromText[index]; 100if (s1[i] != s2[i])
src\RoslynAnalyzers\Utilities\Compiler\Options\AnalyzerOptionsExtensions.cs (1)
365if (trimmedSuffix[i] != ' ')
src\RoslynAnalyzers\Utilities\Compiler\WellKnownTypeProvider.cs (2)
222if (fullTypeName[i] == '.') 227else if (!IsIdentifierPartCharacter(fullTypeName[i]))
src\RoslynAnalyzers\Utilities\Compiler\WordParser.cs (2)
558char c = _text[_index++]; 576char c = _text[index];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher.Lexer.cs (6)
26if (headerText[Position] == '\\') 80switch (headerText[position]) 86headerText[position] == '*') 124public readonly char CurrentCharacter => headerText[Position]; 126public char EatCurrentCharacter() => headerText[Position++]; 142public readonly char this[int position] => headerText[position];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\AbstractVirtualCharService.cs (6)
33var ch = tokenText[index]; 34var next = tokenText[index + 1]; 165if (tokenText[index] == '"' && tokenText[index + 1] == '"') 171else if (escapeBraces && IsOpenOrCloseBrace(tokenText[index])) 176result.Add(VirtualChar.Create(new Rune(tokenText[index]), span));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\AbstractVirtualCharService.ITextInfo.cs (1)
29public readonly char Get(string text, int index) => text[index];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\VirtualCharSequence.Chunks.cs (3)
102if (char.IsHighSurrogate(data[index])) 105!char.IsLowSurrogate(data[index + 1])); 110var ch = data[index];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\StringExtensions.cs (8)
20if (!char.IsWhiteSpace(line[i])) 35if (!char.IsWhiteSpace(line[i])) 87if (textSnippet[i] == '\t') 109if (predicate(text[i])) 158if (text[i] == '\n') 162else if (text[i] == '\r') 164if (i + 1 == text.Length || text[i + 1] != '\n') 230if (line[i] == '\t')
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\FormattingExtensions.cs (3)
228if (text[i] is not ' ' and not '\t') 245if (i >= newText.Length || text[i] != newText[i])
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\TriviaEngine\AbstractTriviaFormatter.cs (5)
147if (!IsWhitespace(text[i]) || !IsNewLine(text[i])) 503if (!char.IsWhiteSpace(this.OriginalString[i])) 533if (!IsWhitespace(this.OriginalString[i])) 743if (this.OriginalString[i] == '\n')
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.cs (11)
180private static readonly Func<string, TextSpan, bool> s_firstCharIsLowerCase = (val, span) => !DoesCharacterHaveCasing(val[span.Start]) || char.IsLower(val[span.Start]); 181private static readonly Func<string, TextSpan, bool> s_firstCharIsUpperCase = (val, span) => !DoesCharacterHaveCasing(val[span.Start]) || char.IsUpper(val[span.Start]); 187if (DoesCharacterHaveCasing(val[i]) && !char.IsUpper(val[i])) 200if (DoesCharacterHaveCasing(val[i]) && !char.IsLower(val[i])) 348switch (char.ToLowerInvariant(name[index])) 353if (index + 2 < name.Length && name[index + 1] == '_') 362if (index + 1 < name.Length && !char.IsDigit(name[index + 1]))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\ISyntaxFactsExtensions.cs (1)
263if (!syntaxFacts.IsIdentifierPartCharacter(name[i]))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (16)
65Debug.Assert(Data[Position] == c); 87Debug.Assert(char.IsNumber(Data[Position])); 92while (char.IsNumber(Data[Position])) 94var digit = Data[Position] - '0'; 139if ((SymbolKeyType)Data[Position] == SymbolKeyType.Null) 152if (Data[Position] != DoubleQuoteChar) 160if (Data[Position + 1] == DoubleQuoteChar) 202Debug.Assert((SymbolKeyType)Data[Position] != SymbolKeyType.Null); 261var ch = Data[Position]; 266var type = (SymbolKeyType)Data[Position]; 272else if (Data[Position] == DoubleQuoteChar) 306_builder.Append(Data[i]); 474var type = (SymbolKeyType)Data[Position]; 485type = (SymbolKeyType)Data[Position]; 547Debug.Assert((SymbolKeyType)Data[Position] != SymbolKeyType.Null); 646if ((SymbolKeyType)Data[Position] == SymbolKeyType.Null)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\Base64Utilities.cs (1)
338while (index >= 0 && attributeData[index] == '=')
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BKTree.cs (1)
79lowerCaseCharacters[i] = CaseInsensitiveComparison.ToLower(value[i]);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EditDistance.cs (2)
62array[i] = CaseInsensitiveComparison.ToLower(text[i]); 94targetLowerCaseCharacters[i] = CaseInsensitiveComparison.ToLower(target[i]);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\StringBreaker.cs (9)
46var firstChar = identifier[wordStart]; 86var c = identifier[current]; 108var c = identifier[current]; 118while (current < length && char.IsUpper(identifier[current])) 123if (current < length && IsLower(identifier[current])) 126Debug.Assert(char.IsUpper(identifier[current - 1])); 153while (current < length && IsLower(identifier[current])) 164while (current < length && char.IsDigit(identifier[current])) 176var ch = identifier[wordStart];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\StringEscapeEncoder.cs (2)
46builder.AppendFormat("{0:X2}", (int)text[index]); 105var ch = text[i];
Microsoft.CodeAnalysis.Scripting (10)
Hosting\ObjectFormatter\CommonObjectFormatter.Visitor.cs (2)
793char c = format[i++]; 796if (i >= 2 && format[i - 2] == '\\')
Hosting\ObjectFormatter\ObjectFormatterHelpers.cs (8)
416if (end - 3 >= start && str[end - 2] == 'n' && str[end - 1] == 'q') 419while (j >= start && Char.IsWhiteSpace(str[j])) 424if (j >= start && str[j] == ',') 433if (i > start && str[i] == ')') 438if (str[i] != '(') 457while (i >= start && Char.IsWhiteSpace(str[i])) 465while (i < end && Char.IsWhiteSpace(str[i]))
Microsoft.CodeAnalysis.Test.Utilities (6)
Assert\AssertEx.cs (4)
455int dist3 = rows[curRow][j - 1] + (first[i - 1].Equals(second[j - 1]) ? 0 : 1); 737var c = str[i++]; 738if (c == '\r' && i < str.Length && str[i] == '\n')
TestHelpers.cs (2)
88var c = text[i]; 89if ((c == '-') && (i > 0) && (text[i - 1] == '-'))
Microsoft.CodeAnalysis.UnitTests (2)
Text\LargeTextTests.cs (2)
69Assert.Equal(HelloWorld[i], text[i]); 91Assert.Equal(HelloWorld[i - destOffset], buffer[i]);
Microsoft.CodeAnalysis.Workspaces (130)
Differencing\LongestCommonSubstring.cs (2)
21=> oldSequence[oldIndex] == newSequence[newIndex];
FindSymbols\FindReferences\Finders\AbstractReferenceFinder_GlobalSuppressions.cs (1)
220var ch = valueText[offsetOfReferenceInToken++];
PatternMatching\AllLowerCamelCaseMatcher.cs (4)
87var patternCharacter = patternChunkText[patternIndex]; 97if (ToLower(candidate[candidateHump.Start], _textInfo) == patternCharacter) 258if (ToLower(s1[start1 + i], textInfo) != ToLower(s2[start2 + i], textInfo))
PatternMatching\PatternMatcher.cs (7)
117if (char.IsUpper(pattern[i])) 129if (char.IsLower(pattern[i])) 227var resultType = char.IsUpper(candidate[caseSensitiveIndex]) ? PatternMatchKind.StartOfWordSubstring : PatternMatchKind.NonLowercaseSubstring; 243if (char.IsUpper(candidate[caseInsensitiveIndex])) 314var ch = text[i]; 576if (!char.IsUpper(patternChunk.Text[patternHumps[currentPatternHump - 1].Start]) || 577!char.IsUpper(patternChunk.Text[patternHumps[currentPatternHump].Start]))
PatternMatching\PatternMatcher.PatternSegment.cs (2)
49if (IsWordChar(pattern[i])) 87var ch = pattern[i];
Rename\ConflictEngine\ConflictResolver.cs (4)
470if (str1[currentIndex] != str2[currentIndex]) 494var previousChar = metadataName[index - 1]; 505var nextChar = metadataName[index + searchText.Length];
Shared\Extensions\SourceTextExtensions.cs (3)
94if (!Match(normalized[j], text[i + j], caseSensitive)) 127if (!Match(normalized[j], text[i + j], caseSensitive)) 155if (text[position + i] != value[i])
Shared\Utilities\BloomFilter.cs (1)
231var c = key[index];
src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (12)
53while (lastSeparator > 0 && IsDirectorySeparator(s[lastSeparator - 1])) 71if (s.Length == 0 || IsAnyDirectorySeparator(s[s.Length - 1])) 145if (IsDirectorySeparator(path[i])) 147if (i > 0 && IsDirectorySeparator(path[i - 1])) 240if (!IsDirectorySeparator(path[i])) 276while (i < length && IsDirectorySeparator(path[i])) 440char c = root[root.Length - 1]; 479if (path.Length > 0 && IsDirectorySeparator(path[path.Length - 1])) 611&& (IsDirectorySeparator(parentPath[parentPath.Length - 1]) || IsDirectorySeparator(childPath[parentPath.Length])); 663if (!PathCharEqual(path1[i], path2[i]))
src\Compilers\Core\Portable\InternalUtilities\FileNameUtilities.cs (2)
122if (path.Length > 0 && path[path.Length - 1] == '.') 175char ch = path[i];
src\Compilers\Core\Portable\InternalUtilities\StringExtensions.cs (7)
173char c = str[i++]; 178if (i < str.Length && char.IsLowSurrogate(str[i])) 208if (arg.Length > 1 && arg[0] == '"' && arg[arg.Length - 1] == '"') 224char.ToUpper(string1[x]) == char.ToUpper(string2[x])) 236string1[x] == string2[x])
src\Compilers\Core\Portable\InternalUtilities\StringTable.cs (3)
489if (array[i] != text[start + i]) 545if (ascii[i] != text[i])
src\Compilers\Core\Portable\InternalUtilities\UnicodeCharacterUtilities.cs (1)
106if (!IsIdentifierPartCharacter(name[i]))
src\Compilers\Core\Portable\Syntax\SyntaxTreeExtensions.cs (4)
65found = fromNode[index]; 66expected = fromText[index]; 100if (s1[i] != s2[i])
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher.Lexer.cs (6)
26if (headerText[Position] == '\\') 80switch (headerText[position]) 86headerText[position] == '*') 124public readonly char CurrentCharacter => headerText[Position]; 126public char EatCurrentCharacter() => headerText[Position++]; 142public readonly char this[int position] => headerText[position];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\AbstractVirtualCharService.cs (6)
33var ch = tokenText[index]; 34var next = tokenText[index + 1]; 165if (tokenText[index] == '"' && tokenText[index + 1] == '"') 171else if (escapeBraces && IsOpenOrCloseBrace(tokenText[index])) 176result.Add(VirtualChar.Create(new Rune(tokenText[index]), span));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\AbstractVirtualCharService.ITextInfo.cs (1)
29public readonly char Get(string text, int index) => text[index];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\VirtualCharSequence.Chunks.cs (3)
102if (char.IsHighSurrogate(data[index])) 105!char.IsLowSurrogate(data[index + 1])); 110var ch = data[index];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\StringExtensions.cs (8)
20if (!char.IsWhiteSpace(line[i])) 35if (!char.IsWhiteSpace(line[i])) 87if (textSnippet[i] == '\t') 109if (predicate(text[i])) 158if (text[i] == '\n') 162else if (text[i] == '\r') 164if (i + 1 == text.Length || text[i + 1] != '\n') 230if (line[i] == '\t')
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\FormattingExtensions.cs (3)
228if (text[i] is not ' ' and not '\t') 245if (i >= newText.Length || text[i] != newText[i])
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\TriviaEngine\AbstractTriviaFormatter.cs (5)
147if (!IsWhitespace(text[i]) || !IsNewLine(text[i])) 503if (!char.IsWhiteSpace(this.OriginalString[i])) 533if (!IsWhitespace(this.OriginalString[i])) 743if (this.OriginalString[i] == '\n')
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.cs (11)
180private static readonly Func<string, TextSpan, bool> s_firstCharIsLowerCase = (val, span) => !DoesCharacterHaveCasing(val[span.Start]) || char.IsLower(val[span.Start]); 181private static readonly Func<string, TextSpan, bool> s_firstCharIsUpperCase = (val, span) => !DoesCharacterHaveCasing(val[span.Start]) || char.IsUpper(val[span.Start]); 187if (DoesCharacterHaveCasing(val[i]) && !char.IsUpper(val[i])) 200if (DoesCharacterHaveCasing(val[i]) && !char.IsLower(val[i])) 348switch (char.ToLowerInvariant(name[index])) 353if (index + 2 < name.Length && name[index + 1] == '_') 362if (index + 1 < name.Length && !char.IsDigit(name[index + 1]))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\ISyntaxFactsExtensions.cs (1)
263if (!syntaxFacts.IsIdentifierPartCharacter(name[i]))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (16)
65Debug.Assert(Data[Position] == c); 87Debug.Assert(char.IsNumber(Data[Position])); 92while (char.IsNumber(Data[Position])) 94var digit = Data[Position] - '0'; 139if ((SymbolKeyType)Data[Position] == SymbolKeyType.Null) 152if (Data[Position] != DoubleQuoteChar) 160if (Data[Position + 1] == DoubleQuoteChar) 202Debug.Assert((SymbolKeyType)Data[Position] != SymbolKeyType.Null); 261var ch = Data[Position]; 266var type = (SymbolKeyType)Data[Position]; 272else if (Data[Position] == DoubleQuoteChar) 306_builder.Append(Data[i]); 474var type = (SymbolKeyType)Data[Position]; 485type = (SymbolKeyType)Data[Position]; 547Debug.Assert((SymbolKeyType)Data[Position] != SymbolKeyType.Null); 646if ((SymbolKeyType)Data[Position] == SymbolKeyType.Null)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\Base64Utilities.cs (1)
338while (index >= 0 && attributeData[index] == '=')
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BKTree.cs (1)
79lowerCaseCharacters[i] = CaseInsensitiveComparison.ToLower(value[i]);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EditDistance.cs (2)
62array[i] = CaseInsensitiveComparison.ToLower(text[i]); 94targetLowerCaseCharacters[i] = CaseInsensitiveComparison.ToLower(target[i]);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\StringBreaker.cs (9)
46var firstChar = identifier[wordStart]; 86var c = identifier[current]; 108var c = identifier[current]; 118while (current < length && char.IsUpper(identifier[current])) 123if (current < length && IsLower(identifier[current])) 126Debug.Assert(char.IsUpper(identifier[current - 1])); 153while (current < length && IsLower(identifier[current])) 164while (current < length && char.IsDigit(identifier[current])) 176var ch = identifier[wordStart];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\StringEscapeEncoder.cs (2)
46builder.AppendFormat("{0:X2}", (int)text[index]); 105var ch = text[i];
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (1)
373if (p.Length > 0 && char.IsLetter(name[p.Start]))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\TypeInferenceService\AbstractTypeInferenceService.cs (1)
72var nextChar = name[prefix.Length];
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (35)
src\Compilers\Core\Portable\CaseInsensitiveComparison.cs (9)
114int ordDiff = CompareLowerUnicode(str1[i], str2[i]); 165if (!AreEqualLowerUnicode(str1[i], str2[i])) 214if (!AreEqualLowerUnicode(value[i], possibleEnd[j])) 245if (!AreEqualLowerUnicode(value[i], possibleStart[i])) 260hashCode = Hash.CombineFNVHash(hashCode, ToLower(str[i]));
src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (12)
53while (lastSeparator > 0 && IsDirectorySeparator(s[lastSeparator - 1])) 71if (s.Length == 0 || IsAnyDirectorySeparator(s[s.Length - 1])) 145if (IsDirectorySeparator(path[i])) 147if (i > 0 && IsDirectorySeparator(path[i - 1])) 240if (!IsDirectorySeparator(path[i])) 276while (i < length && IsDirectorySeparator(path[i])) 440char c = root[root.Length - 1]; 479if (path.Length > 0 && IsDirectorySeparator(path[path.Length - 1])) 611&& (IsDirectorySeparator(parentPath[parentPath.Length - 1]) || IsDirectorySeparator(childPath[parentPath.Length])); 663if (!PathCharEqual(path1[i], path2[i]))
src\Compilers\Core\Portable\InternalUtilities\FileNameUtilities.cs (2)
122if (path.Length > 0 && path[path.Length - 1] == '.') 175char ch = path[i];
src\Compilers\Core\Portable\InternalUtilities\JsonWriter.cs (1)
274char c = value[i];
src\Compilers\Core\Portable\InternalUtilities\StringExtensions.cs (7)
173char c = str[i++]; 178if (i < str.Length && char.IsLowSurrogate(str[i])) 208if (arg.Length > 1 && arg[0] == '"' && arg[arg.Length - 1] == '"') 224char.ToUpper(string1[x]) == char.ToUpper(string2[x])) 236string1[x] == string2[x])
src\Compilers\Core\Portable\InternalUtilities\StringTable.cs (3)
489if (array[i] != text[start + i]) 545if (ascii[i] != text[i])
src\Compilers\Core\Portable\InternalUtilities\UnicodeCharacterUtilities.cs (1)
106if (!IsIdentifierPartCharacter(name[i]))
Microsoft.CodeAnalysis.Workspaces.UnitTests (6)
Differencing\LongestCommonSubsequenceTests.cs (4)
19=> oldSequence[oldIndex] == newSequence[newIndex]; 60newChars[edit.NewIndex] = newStr[edit.NewIndex]; 66newChars[edit.NewIndex] = oldStr[edit.OldIndex];
UtilityTest\BKTreeTests.cs (2)
108=> value[..i] + value[i + 1] + value[i] + value[(i + 2)..];
Microsoft.CSharp (4)
Microsoft\CSharp\RuntimeBinder\Syntax\NameTable.cs (4)
80hashCode += (hashCode << 7) ^ key[i]; 101hashCode += (hashCode << 7) ^ key[i]; 125if (candidate[i] != key[i])
Microsoft.Data.Analysis (8)
TextFieldParser.cs (8)
57if (line[_index] == '"') 71if (_index + 1 < line.Length && line[_index + 1] == '"') 92if (_spaceChars.IndexOf(line[i]) < 0) 111_field.Append(line[_index]); 920if (line[length - 2].Equals('\r') || line[length - 2].Equals('\n')) 924if (line[length - 1].Equals('\r') || line[length - 1].Equals('\n'))
Microsoft.Data.Analysis.Tests (8)
src\Microsoft.Data.Analysis\TextFieldParser.cs (8)
57if (line[_index] == '"') 71if (_index + 1 < line.Length && line[_index + 1] == '"') 92if (_spaceChars.IndexOf(line[i]) < 0) 111_field.Append(line[_index]); 920if (line[length - 2].Equals('\r') || line[length - 2].Equals('\n')) 924if (line[length - 1].Equals('\r') || line[length - 1].Equals('\n'))
Microsoft.DotNet.Arcade.Sdk (3)
src\GenerateResxSource.cs (2)
447if (original[i] == '\"') 451stringLiteral.Append(original[i]);
src\GenerateSourcePackageSourceLinkTargetsFile.cs (1)
98char last = path[path.Length - 1];
Microsoft.DotNet.Build.Manifest (1)
VersionIdentifier.cs (1)
110nextDelimiterCharacter = assetPathSegment[nextDelimiterIndex];
Microsoft.DotNet.Build.Tasks.Packaging (1)
ValidatePackage.cs (1)
501bool isExclusiveVersion = fxString.Length > 1 && fxString[0] == '[' && fxString[fxString.Length - 1] == ']';
Microsoft.DotNet.Build.Tasks.Templating (3)
GenerateFileFromTemplate.cs (3)
84char templateChar = template[i]; 87: template[i + 1]; 114templateChar = template[i];
Microsoft.DotNet.RemoteExecutor (4)
PasteArguments.cs (4)
92char c = argument[idx++]; 96while (idx < argument.Length && argument[idx] == Backslash) 107else if (argument[idx] == Quote) 143char c = s[i];
Microsoft.DotNet.SignTool (1)
src\Hash.cs (1)
238hashCode = unchecked((hashCode ^ text[i]) * Hash.FnvPrime);
Microsoft.Extensions.ApiDescription.Client (1)
CSharpIdentifier.cs (1)
48var ch = inputName[i];
Microsoft.Extensions.Caching.Hybrid.Tests (1)
TagSetTests.cs (1)
174chars[i] = Alphabet[rand.Next(0, Alphabet.Length)];
Microsoft.Extensions.Compliance.Abstractions.Tests (1)
Redaction\TestSpanFormattable.cs (1)
35destination[i] = _value[i];
Microsoft.Extensions.Configuration (1)
ConfigurationProvider.cs (1)
82kv.Key[parentPath.Length] == ':')
Microsoft.Extensions.Configuration.Ini (2)
IniStreamConfigurationProvider.cs (2)
49if (line[0] == '[' && line[line.Length - 1] == ']') 71if (value.Length > 1 && value[0] == '"' && value[value.Length - 1] == '"')
Microsoft.Extensions.Configuration.UserSecrets (1)
PathHelper.cs (1)
54userSecretsId[badCharIndex],
Microsoft.Extensions.Diagnostics.ResourceMonitoring.Tests (2)
Linux\Resources\FileNamesOnlyFileSystem.cs (1)
53destination[i] = c[i];
Linux\Resources\HardcodedValueFileSystem.cs (1)
84destination[i] = toRead[i];
Microsoft.Extensions.FileProviders.Embedded (3)
EmbeddedFileProvider.cs (2)
238if (!IsValidEverettIdChar(subName[i])) 244builder.Append(subName[i]);
Manifest\EmbeddedFilesManifest.cs (1)
72var end = Array.IndexOf(_separators, path[path.Length - 1]) == -1 ? path.Length : path.Length - 1;
Microsoft.Extensions.FileProviders.Physical (3)
Internal\PathUtils.cs (1)
46path[path.Length - 1] != Path.DirectorySeparatorChar)
PhysicalFilesWatcher.cs (2)
449(path[path.Length - 1] == Path.DirectorySeparatorChar || 450path[path.Length - 1] == Path.AltDirectorySeparatorChar);
Microsoft.Extensions.FileSystemGlobbing (12)
InMemoryDirectoryInfo.cs (1)
125(rootDir[rootDirLength - 1] == Path.DirectorySeparatorChar ||
Internal\Patterns\PatternBuilder.cs (11)
58if (pattern[beginSegment] == '*' && 59pattern[beginSegment + 1] == '.' && 60pattern[beginSegment + 2] == '*') 69if (pattern[beginSegment] == '*' && 70pattern[beginSegment + 1] == '*') 75else if (pattern[beginSegment] == '.' && 76pattern[beginSegment + 1] == '.') 90if (pattern[beginSegment] == '.') 99if (pattern[beginSegment] == '*' && 100pattern[beginSegment + 1] == '*' && 101pattern[beginSegment + 2] == '.')
Microsoft.Extensions.Http.Diagnostics (6)
Http\DownstreamDependencyMetadataManager.cs (6)
139char ch = route[i]; 156trieCurrent.Delimiter = route[i + 1]; 163char ch = httpMethod[j]; 308char ch = hostNameSuffix[i]; 330char ch = host[i]; 436char ch = _toUpper[httpMethod[j]];
Microsoft.Extensions.Http.Diagnostics.Tests (1)
Logging\Internal\RandomStringGenerator.cs (1)
20.Select(s => s[_random.Next(s.Length)]).ToArray());
Microsoft.Extensions.Identity.Core (8)
Base32.cs (8)
61sb.Append((numCharsToOutput >= 1) ? _base32Chars[a] : '='); 62sb.Append((numCharsToOutput >= 2) ? _base32Chars[b] : '='); 63sb.Append((numCharsToOutput >= 3) ? _base32Chars[c] : '='); 64sb.Append((numCharsToOutput >= 4) ? _base32Chars[d] : '='); 65sb.Append((numCharsToOutput >= 5) ? _base32Chars[e] : '='); 66sb.Append((numCharsToOutput >= 6) ? _base32Chars[f] : '='); 67sb.Append((numCharsToOutput >= 7) ? _base32Chars[g] : '='); 68sb.Append((numCharsToOutput >= 8) ? _base32Chars[h] : '=');
Microsoft.Extensions.Logging.Abstractions (2)
LogValuesFormatter.cs (2)
97if (braceOccurrenceCount > 0 && format[scanIndex] != brace) 111else if (format[scanIndex] == brace)
Microsoft.Extensions.Logging.EventSource (1)
LoggingEventSource.cs (1)
448if (loggerName[loggerName.Length - 1] == '*')
Microsoft.Extensions.Logging.Generators (5)
LoggerMessageGenerator.Emitter.cs (3)
584if (s[index] is '\n' or '\r' or '"') 601switch (s[index]) 619sb.Append(s[index]);
LoggerMessageGenerator.Parser.cs (2)
805char current = message[scanIndex]; 814current = message[scanIndex];
Microsoft.Extensions.Options.SourceGeneration (1)
Parser.cs (1)
850_ = s[index] switch
Microsoft.Extensions.Primitives (1)
StringSegment.cs (1)
109return Buffer[Offset + index];
Microsoft.Extensions.Telemetry (5)
Http\HttpRouteParser.cs (5)
108ch = httpRoute[pos]; 164while ((ch = httpRoute[pos]) != '}') 193else if (!catchAllParamFound && ch == '*' && pos > 0 && httpRoute[pos - 1] == '{') 198if (httpRoute[paramNameStart] == '*') 216if (!(isLastPosition || (isSecondToLastPosition && httpRoute[pos + 1] == '/')))
Microsoft.Gen.Logging (3)
Emission\Emitter.Utils.cs (1)
33_ = s[index] switch
Parsing\TemplateProcessor.cs (2)
149char current = message[scanIndex]; 158current = message[scanIndex];
Microsoft.Maui (1)
Fonts\FontFile.cs (1)
144 var last = currentString[currentString.Length - 1];
Microsoft.Maui.Controls (23)
BindingExpression.cs (1)
239 if (part[rbIndex] != ']')
Items\ItemsLayoutTypeConverter.cs (1)
45 else if (strValue.Length > identifierLength + 1 && strValue[identifierLength] == ',')
Shapes\PathFigureCollectionConverter.cs (21)
57 if (pathString[curIndex] == 'F') 69 ((pathString[curIndex] != '0') && 70 (pathString[curIndex] != '1'))) 353 char ch = currentPathString[currentIndex]; 396 token = currentPathString[currentIndex++]; 420 token = currentPathString[currentIndex++]; 455 token = currentPathString[currentIndex]; 488 if (More() && ((currentPathString[currentIndex] == '-') || currentPathString[currentIndex] == '+')) 494 if (More() && (currentPathString[currentIndex] == 'I')) 502 else if (More() && (currentPathString[currentIndex] == 'N')) 516 if (More() && (currentPathString[currentIndex] == '.')) 524 if (More() && ((currentPathString[currentIndex] == 'E') || (currentPathString[currentIndex] == 'e'))) 536 if (currentPathString[start] == '+') 540 else if (currentPathString[start] == '-') 550 value = value * 10 + (currentPathString[start] - '0'); 574 if (signAllowed && More() && ((currentPathString[currentIndex] == '-') || currentPathString[currentIndex] == '+')) 579 while (More() && (currentPathString[currentIndex] >= '0') && (currentPathString[currentIndex] <= '9'))
Microsoft.Maui.Controls.Build.Tasks (1)
ExpandMarkupsVisitor.cs (1)
89 if (expression[expression.Length - 1] != '}')
Microsoft.Maui.Controls.SourceGen (3)
src\Controls\src\Xaml\TypeArgumentsParser.cs (3)
42 if (match[pos] == '(') 47 else if (match[pos] == ')') 49 else if (match[pos] == ',' && parensCount == 0)
Microsoft.Maui.Controls.Xaml (21)
ExpandMarkupsVisitor.cs (1)
83 if (expression[expression.Length - 1] != '}')
MarkupExpressionParser.cs (15)
58 if (expression[expression.Length - 1] != '}') 93 if (expression[i] == ' ') 109 if (expression[i + c] == ' ' || expression[i + c] == '}') 182 (inString || (remaining[end] != '}' && remaining[end] != ',' && remaining[end] != '='))) 186 if (remaining[end] == stringTerminator) 190 while (remaining[end] == ' ') 197 if (remaining[end] == '\'' || remaining[end] == '"') 200 stringTerminator = remaining[end]; 207 if (remaining[end] == '\\') 213 piece.Append(remaining[end]); 223 next = remaining[end];
TypeArgumentsParser.cs (3)
42 if (match[pos] == '(') 47 else if (match[pos] == ')') 49 else if (match[pos] == ',' && parensCount == 0)
XamlLoader.cs (2)
405 while (index < xaml.Length && xaml[index] == ' ') 415 if (index < xaml.Length && xaml[index] != character)
Microsoft.Maui.Essentials (1)
TextToSpeech\TextToSpeech.shared.cs (1)
101 var ch = text[positionend];
Microsoft.Maui.Graphics.Skia (1)
SkiaTextLayout.cs (1)
233 if (char.IsWhiteSpace(_value[i]))
Microsoft.ML.AutoML (2)
Utils\StringEditDistance.cs (2)
44var substitution = rows[currentRow, j - 1] + (first[i - 1].Equals(second[j - 1]) ? 0 : 1);
Microsoft.ML.Core (24)
CommandLine\CharCursor.cs (4)
29_chCur = _ichCur < _ichLim ? _text[_ichCur] : '\x00'; 40_chCur = _ichCur < _ichLim ? _text[_ichCur] : '\x00'; 52_chCur = _text[_ichCur]; 67return _text[ich];
CommandLine\CmdLexer.cs (7)
453if (sb[ichDst + ichSrc] != str[ichSrc]) 489char ch = _str[_ich++]; 517Contracts.Assert(ichMin >= 0 && _str[ichMin] == '\\'); 518Contracts.Assert(ichMin == 0 || _str[ichMin - 1] != '\\'); 521while (_ich < _str.Length && _str[_ich] == '\\') 532switch (_str[_ich]) 540_sb.Append(_str[_ich++]);
CommandLine\CmdParser.cs (5)
453for (firstNonUpper = 0; firstNonUpper < name.Length && char.IsUpper(name[firstNonUpper]); ++firstNonUpper) 712if (ichLim > 0 && str[ichLim] == ':') 931while (index < helpStrings.Help.Length && helpStrings.Help[index] == ' ') 1165if (ich == 0 || str[str.Length - 1] != '}') 2141switch (HelpText[HelpText.Length - 1])
Data\ModelHeader.cs (3)
265char ch = sig[ich]; 291char ch = sig[ich]; 647char ch = modelSignature[ich];
Data\Repository.cs (1)
255_ectx.Check(entityPath.Length > ichSplit && entityPath[ichSplit] == Path.DirectorySeparatorChar);
Environment\HostEnvironmentBase.cs (4)
546while (ichLim < message.Length && message[ichLim] != '\r' && message[ichLim] != '\n') 560if (ichMin < message.Length && message[ichLim] == '\r' && message[ichMin] == '\n')
Microsoft.ML.Data (14)
DataLoadSave\Text\TextLoader.cs (1)
372AllOther = str[ich] == '~';
DataLoadSave\Text\TextLoaderCursor.cs (10)
564while (ichCur < ichLim && IsSep(line[ichCur])) 577while (ichCur < ichLim && line[ichCur] == ' ') 584if (startsInsideQuoted || line[ichCur] == '"') 600if (line[ichCur] == '"') 606if (line[ichCur] == '"') 625if (line[ichCur] == _escapeChar) 634else if (line[ichCur] == '"') 648while (ichCur < ichLim && line[ichCur] == ' ') 656if (ichCur >= ichLim || IsSep(line[ichCur])) 665while (ichCur < ichLim && !IsSep(line[ichCur]))
DataLoadSave\Text\TextSaver.cs (1)
639if (sb[ich] != def[ich])
Model\Pfa\ModelUtils.cs (1)
25for (firstNonUpper = 0; firstNonUpper < name.Length && char.IsUpper(name[firstNonUpper]); ++firstNonUpper)
Utilities\TypeParsingUtils.cs (1)
36if (str[str.Length - 1] != ']')
Microsoft.ML.GenAI.Mistral (1)
MistralCausalLMAgent.cs (1)
164.Select(s => s[random.Next(s.Length)]).ToArray());
Microsoft.ML.ImageAnalytics (1)
ImagePixelExtractor.cs (1)
554switch (str[i])
Microsoft.ML.InternalCodeAnalyzer (1)
Utils.cs (1)
32char c = name[i];
Microsoft.ML.PerformanceTests (2)
BenchmarkBase.cs (1)
116columnSB.Append(characters[random.Next(characters.Length)]);
ImageClassificationBench.cs (1)
119if (!char.IsLetter(label[index]))
Microsoft.ML.Predictor.Tests (24)
CmdLine\CmdIndenterTest.cs (4)
61while (ichLim < text.Length && text[ichLim] != '$') 63if (text[ichLim] == '\n') 68while (ichMin < ichLim && char.IsWhiteSpace(text[ichMin])) 70if (text[ichMin] == '\n')
CmdLine\CmdLine.cs (4)
363while (ichLim < text.Length && text[ichLim] != '$') 365if (text[ichLim] == '\n') 370while (ichMin < ichLim && char.IsWhiteSpace(text[ichMin])) 372if (text[ichMin] == '\n')
CompareBaselines.cs (16)
223if (f1 || f2 || line1[ich1] != line2[ich2]) 282while (ich < line.Length && line[ich] == ' ') 288if (ich > 0 && line[ich - 1] < _forbidNumAfter.Length && _forbidNumAfter[line[ich - 1]]) 298if (ichLim < line.Length && line[ichLim] == '.') 314d = line[ich] == '-' ? double.NegativeInfinity : double.PositiveInfinity; 323if (ichLim < line.Length && (line[ichLim] == 'e' || line[ichLim] == 'E')) 344if (ich >= line.Length || !IsDigit(line[ich])) 348while (ich < line.Length && IsDigit(line[ich])) 361if (ich < line.Length && (line[ich] == '-' || line[ich] == '+')) 367if (ich > line.Length - val.Length || line[ich] != val[0]) 371if (line[ich + i] != val[i])
Microsoft.ML.Samples (7)
Dynamic\Trainers\MulticlassClassification\ImageClassification\ImageClassificationDefault.cs (2)
186if (!char.IsLetter(label[index])) 222if (!char.IsLetter(label[index]))
Dynamic\Trainers\MulticlassClassification\ImageClassification\LearningRateSchedulingCifarResnetTransferLearning.cs (2)
214if (!char.IsLetter(label[index])) 252if (!char.IsLetter(label[index]))
Dynamic\Trainers\MulticlassClassification\ImageClassification\ResnetV2101TransferLearningEarlyStopping.cs (1)
210if (!char.IsLetter(label[index]))
Dynamic\Trainers\MulticlassClassification\ImageClassification\ResnetV2101TransferLearningTrainTestSplit.cs (2)
195if (!char.IsLetter(label[index])) 231if (!char.IsLetter(label[index]))
Microsoft.ML.Samples.GPU (7)
docs\samples\Microsoft.ML.Samples\Dynamic\Trainers\MulticlassClassification\ImageClassification\ImageClassificationDefault.cs (2)
186if (!char.IsLetter(label[index])) 222if (!char.IsLetter(label[index]))
docs\samples\Microsoft.ML.Samples\Dynamic\Trainers\MulticlassClassification\ImageClassification\LearningRateSchedulingCifarResnetTransferLearning.cs (2)
214if (!char.IsLetter(label[index])) 252if (!char.IsLetter(label[index]))
docs\samples\Microsoft.ML.Samples\Dynamic\Trainers\MulticlassClassification\ImageClassification\ResnetV2101TransferLearningEarlyStopping.cs (1)
210if (!char.IsLetter(label[index]))
docs\samples\Microsoft.ML.Samples\Dynamic\Trainers\MulticlassClassification\ImageClassification\ResnetV2101TransferLearningTrainTestSplit.cs (2)
195if (!char.IsLetter(label[index])) 231if (!char.IsLetter(label[index]))
Microsoft.ML.TensorFlow.Tests (1)
TensorflowTests.cs (1)
1931if (!char.IsLetter(label[index]))
Microsoft.ML.TestFramework (5)
PasteArguments.cs (4)
37char c = argument[idx++]; 41while (idx < argument.Length && argument[idx] == Backslash) 52else if (argument[idx] == Quote) 88char c = s[i];
SubComponent.cs (1)
177if (ich == 0 || str[str.Length - 1] != '}')
Microsoft.ML.Tests (4)
ExpressionLanguageTests\ExpressionLanguageTests.cs (4)
133while (ichLim < text.Length && text[ichLim] != '$') 135if (text[ichLim] == '\n') 140while (ichMin < ichLim && char.IsWhiteSpace(text[ichMin])) 142if (text[ichMin] == '\n')
Microsoft.ML.Tokenizers (13)
Model\EnglishRobertaTokenizer.cs (1)
289if (unicodeToByte.TryGetValue(v[j], out var c))
Model\SentencePieceBaseModel.cs (1)
325if (token[token.Length - 1] == prefixSuffixChar)
Normalizer\BertNormalizer.cs (5)
47char c = original[i]; 56if (char.IsHighSurrogate(c) && i + 1 < original.Length && char.IsLowSurrogate(original[i + 1])) 58codePoint = char.ConvertToUtf32(c, original[i + 1]); 100AddChar(ref buffer, ref index, original[i + 1]); 111AddChar(ref buffer, ref index, original[i + 1]);
Utils\OrdinalUtf8StringComparer.cs (6)
32char c = x[i]; 33char d = y[i]; 42return (int)x[i] - (int)y[i]; 47while (i > 0 && (Char.IsSurrogate(x[i - 1]) || Char.IsSurrogate(y[i - 1])))
Microsoft.ML.Tokenizers.Tests (6)
src\Microsoft.ML.Tokenizers\Utils\OrdinalUtf8StringComparer.cs (6)
32char c = x[i]; 33char d = y[i]; 42return (int)x[i] - (int)y[i]; 47while (i > 0 && (Char.IsSurrogate(x[i - 1]) || Char.IsSurrogate(y[i - 1])))
Microsoft.ML.TorchSharp (11)
Roberta\QATrainer.cs (11)
454else if (i + 1 < text.Length && char.IsSurrogatePair(text[i], text[i + 1])) 460else if (char.IsWhiteSpace(text[i])) 465else if (!robertaModel.IsSupportedChar(text[i])) 472&& ((text[i] == '`' && text[i + 1] == '`') 473|| (text[i] == '\'' && text[i + 1] == '\'') 474|| (text[i] == '\\' && text[i + 1] == '"'))) 481else if (text[i] == tokens[tid][j])
Microsoft.ML.Transforms (2)
Expression\Tokens.cs (2)
189if ((uint)(s[i] - '0') > 9) 229char ch = str[ich];
Microsoft.Net.Http.Headers (2)
HeaderUtilities.cs (2)
190if (current < headerValue.Length && headerValue[current] == '=') 335if (startIndex >= headerValue.Length - 1 || headerValue[startIndex] != '=')
Microsoft.NET.StringTools (4)
FowlerNollVo1aHash.cs (4)
38char ch = text[i]; 68char ch = text[i]; 93char ch = text[i]; 115char ch = text[i];
Microsoft.NET.StringTools.net35 (6)
FowlerNollVo1aHash.cs (4)
38char ch = text[i]; 68char ch = text[i]; 93char ch = text[i]; 115char ch = text[i];
InternableString.Simple.cs (2)
60public readonly char Current => (_string._builder == null ? _string.FirstString[_charIndex] : _string._builder[_charIndex]); 152if (other[i] != _builder[i])
Microsoft.VisualBasic.Core (127)
Microsoft\VisualBasic\CompilerServices\CharType.vb (1)
21Return Value.Chars(0)
Microsoft\VisualBasic\CompilerServices\Conversions.vb (9)
1539(.CurrencyDecimalSeparator.Chars(0) = .NumberDecimalSeparator.Chars(0)) AndAlso 1540(.CurrencyGroupSeparator.Chars(0) = .NumberGroupSeparator.Chars(0)) AndAlso 1556If (.CurrencyDecimalSeparator.Chars(i) <> .NumberDecimalSeparator.Chars(i)) Then GoTo MisMatch 1560If (.CurrencyGroupSeparator.Chars(i) <> .NumberGroupSeparator.Chars(i)) Then GoTo MisMatch 2045Return Value.Chars(0)
Microsoft\VisualBasic\CompilerServices\DecimalType.vb (8)
162(.CurrencyDecimalSeparator.Chars(0) = .NumberDecimalSeparator.Chars(0)) AndAlso 163(.CurrencyGroupSeparator.Chars(0) = .NumberGroupSeparator.Chars(0)) AndAlso 180If (.CurrencyDecimalSeparator.Chars(i) <> .NumberDecimalSeparator.Chars(i)) Then GoTo MisMatch 184If (.CurrencyGroupSeparator.Chars(i) <> .NumberGroupSeparator.Chars(i)) Then GoTo MisMatch
Microsoft\VisualBasic\CompilerServices\IOUtils.vb (3)
26If PathName.Length > 0 AndAlso PathName.Chars(PathName.Length - 1) = Path.DirectorySeparatorChar Then 46If DirName.Chars(DirName.Length - 1) <> Path.DirectorySeparatorChar Then 51If DirName.Chars(DirName.Length - 1) <> Path.DirectorySeparatorChar Then
Microsoft\VisualBasic\CompilerServices\LikeOperator.vb (31)
153Dim ch As Char = Input.Chars(i) 170Dim ch As Char = Input.Chars(i) 302p = Pattern.Chars(PatternIndex) 311If Not System.Char.IsDigit(Source.Chars(SourceIndex)) Then 399p = Pattern.Chars(PatternIndex) 405((p = "["c AndAlso Pattern.Chars(PatternIndex + 1) = "]"c) OrElse 406(p = ChrW(&HFF3B) AndAlso Pattern.Chars(PatternIndex + 1) = ChrW(&HFF3D))) Then 452Return AscW(Left.Chars(LeftStart)) - AscW(Right.Chars(RightStart)) 496Return Comparer.Compare(Left.Chars(LeftStart), Right.Chars(RightStart), Options) 514Return AscW(Left.Chars(0)) - AscW(Right.Chars(0)) 564(Pattern.Chars(PatternIndex) = "[" OrElse Pattern.Chars(PatternIndex) = ChrW(&HFF3B)), 584Dim p As Char = Pattern.Chars(PatternIndex) 595p = Pattern.Chars(PatternIndex) 606Mismatch = Not (CompareChars(Source.Chars(SourceIndex), "!"c, Comparer, Options) = 0) 680RangeStart = Pattern.Chars(PatternIndex) 691(Pattern.Chars(PatternNextIndex + 1) = "-"c OrElse Pattern.Chars(PatternNextIndex + 1) = ChrW(&HFF0D)) AndAlso 692(Pattern.Chars(PatternNextIndex + 2) <> "]"c AndAlso Pattern.Chars(PatternNextIndex + 2) <> ChrW(&HFF3D)) Then 738RangeEnd = Pattern.Chars(PatternIndex) 799Loop While Pattern.Chars(PatternIndex) <> "]"c AndAlso 800Pattern.Chars(PatternIndex) <> ChrW(&HFF3D) 848p = Pattern.Chars(PatternIndex) 1050Dim p As Char = Pattern.Chars(PatternIndex) 1191(Pattern.Chars(PatternIndex) = "*"c OrElse Pattern.Chars(PatternIndex) = ChrW(&HFF0A)), 1435Dim c As Char = Source.Chars(SourceIndex)
Microsoft\VisualBasic\CompilerServices\StringType.vb (27)
238s = Source.Chars(SourceIndex) 242p = Pattern.Chars(PatternIndex) 253s = Source.Chars(SourceIndex) 261s = Source.Chars(SourceIndex) 270s = Source.Chars(SourceIndex) 275(((PatternIndex + 1) >= PatternEndIndex) OrElse (Pattern.Chars(PatternIndex + 1) <> "]"c)) Then 298s = Source.Chars(SourceIndex) 314s = Source.Chars(SourceIndex) 360s = Source.Chars(SourceIndex) 415s = Source.Chars(SourceIndex) 425p = Pattern.Chars(PatternIndex) 436s = Source.Chars(SourceIndex) 444s = Source.Chars(SourceIndex) 453s = Source.Chars(SourceIndex) 458(((PatternIndex + 1) >= PatternEndIndex) OrElse (Pattern.Chars(PatternIndex + 1) <> "]"c)) Then 480s = Source.Chars(SourceIndex) 496s = Source.Chars(SourceIndex) 550(UnicodeCategory.ModifierSymbol = Char.GetUnicodeCategory(Pattern.Chars(PatternIndex + 1)) OrElse _ 551UnicodeCategory.NonSpacingMark = Char.GetUnicodeCategory(Pattern.Chars(PatternIndex + 1))) 552pstr = pstr & Pattern.Chars(PatternIndex + 1) 556(UnicodeCategory.ModifierSymbol = Char.GetUnicodeCategory(Source.Chars(SourceIndex + 1)) OrElse _ 557UnicodeCategory.NonSpacingMark = Char.GetUnicodeCategory(Source.Chars(SourceIndex + 1))) 558sstr = sstr & Source.Chars(SourceIndex + 1) 571s = Source.Chars(SourceIndex) 644p = Pattern.Chars(PatternIndex) 674If Pattern.Chars(PatternIndex + 1) = "]"c Then 679If Pattern.Chars(PatternIndex + 1) = "]"c Then
Microsoft\VisualBasic\CompilerServices\Utils.LateBinder.vb (9)
144c0 = s.Chars(0) 145c1 = s.Chars(1) 146c2 = s.Chars(2) 155If s.Chars(iIndex) = chPeriod Then 267ch = value.Chars(firstNonspace) 282ch = System.Char.ToLowerInvariant(value.Chars(firstNonspace + 1)) 305ch = value.Chars(firstNonspace) 320ch = System.Char.ToLowerInvariant(value.Chars(firstNonspace + 1)) 694OneChar = sRank.Chars(length - 1)
Microsoft\VisualBasic\CompilerServices\VB6BinaryFile.vb (1)
129Value = s.Chars(0)
Microsoft\VisualBasic\CompilerServices\VB6File.vb (2)
2115If s.Chars(0) = NegativeSign.Chars(0) Then
Microsoft\VisualBasic\CompilerServices\VB6InputFile.vb (2)
84If sInput.Chars(0) = CChar("#") AndAlso sInput.Length <> 1 Then 173Value = s.Chars(0)
Microsoft\VisualBasic\Conversion.vb (11)
532If s.Length > 0 AndAlso s.Chars(0) <> "-"c Then 552ch = InputStr.Chars(i) 558ch = InputStr.Chars(i) 603ch = InputStr.Chars(i) 633ch = InputStr.Chars(i) 674ch = InputStr.Chars(i) 725ch = InputStr.Chars(i) 738ch = InputStr.Chars(i) 750ch = InputStr.Chars(i) 760ch = InputStr.Chars(i) 808ch = InputStr.Chars(i)
Microsoft\VisualBasic\FileIO\FileSystem.vb (1)
938If TargetDirectoryFullPath.Chars(SourceDirectoryFullPath.Length) = IO.Path.DirectorySeparatorChar Then
Microsoft\VisualBasic\FileSystem.vb (1)
102ChDrive(Drive.Chars(0))
Microsoft\VisualBasic\Information.vb (3)
209If Result.Chars(0) = "_"c Then 400If typename.Chars(LastChar) = "]"c Then 578If Result.Chars(0) = "_"c Then
Microsoft\VisualBasic\Strings.vb (18)
219Dim ch As Char = [String].Chars(0) 228Return AscW([String].Chars(0)) 966SingleChar = s.Chars(0) 999Return New String(Character.Chars(0), Number) 1075Select Case Style.Chars(0) 1088Select Case Style.Chars(0) 1105Select Case Style.Chars(0) 1118Select Case Style.Chars(0) 1136Select Case Style.Chars(5) 1157Select Case Style.Chars(6) 1195Select Case Style.Chars(7) 1210Select Case Style.Chars(0) 1219Select Case Style.Chars(0) 1828Return [str].Chars(Index - 1) 1859ch = str.Chars(0) 1936ch = str.Chars(str.Length - 1) 1953Dim ch As Char = str.Chars(0) 1957ch = str.Chars(str.Length - 1)
Microsoft.VisualStudio.LanguageServices (5)
DebuggerIntelliSense\AbstractDebuggerIntelliSenseContext.cs (2)
244if (!char.IsWhiteSpace(text[i])) 248return text[i] == '?' ? i : -1;
Venus\ContainedDocument.cs (3)
438var ch = text[i]; 488var actual = text[index]; 651var ch = text[i];
PresentationBuildTasks (101)
Microsoft\Build\Tasks\Windows\UidManager.cs (2)
1270return Content[Index++]; 1280return Content[Index];
MS\Internal\MarkupCompiler\PathInternal.cs (6)
87if (PathInternal.IsDirectorySeparator(relativeTo[i])) 94else if (PathInternal.IsDirectorySeparator(path[commonLength])) 141&& (commonChars == second.Length || IsDirectorySeparator(second[commonChars]))) 144if (commonChars == second.Length && IsDirectorySeparator(first[commonChars])) 148while (commonChars > 0 && !IsDirectorySeparator(first[commonChars - 1])) 345=> path != null && path.Length > 0 && PathInternal.IsDirectorySeparator(path[path.Length - 1]);
src\Microsoft.DotNet.Wpf\src\PresentationCore\System\Windows\Media\ParsersCommon.cs (22)
122if (pathString[curIndex] == 'F') 135((pathString[curIndex] != '0') && 136(pathString[curIndex] != '1'))) 144fillRule = pathString[curIndex] != '0' ; 210char ch = _pathString[_curIndex]; 258_token = _pathString[_curIndex ++]; 274_token = _pathString[_curIndex]; 296if (signAllowed && More() && ((_pathString[_curIndex] == '-') || _pathString[_curIndex] == '+')) 301while (More() && (_pathString[_curIndex] >= '0') && (_pathString[_curIndex] <= '9')) 352if (More() && ((_pathString[_curIndex] == '-') || _pathString[_curIndex] == '+')) 358if (More() && (_pathString[_curIndex] == 'I')) 368else if (More() && (_pathString[_curIndex] == 'N')) 382if (More() && (_pathString[_curIndex] == '.')) 390if (More() && ((_pathString[_curIndex] == 'E') || (_pathString[_curIndex] == 'e'))) 402if (_pathString[start] == '+') 406else if (_pathString[start] == '-') 416value = value * 10 + (_pathString[start] - '0'); 449_token = _pathString[_curIndex ++];
src\Microsoft.DotNet.Wpf\src\PresentationFramework\MS\Internal\Globalization\LocalizationComments.cs (14)
91if (Char.IsWhiteSpace(input[i]) && !escaped) 104if (input[i] == CommentStart && !escaped) 119else if (input[i] == EscapeChar && !escaped) 125tokenBuffer.Append(input[i]); 135if (input[i] == CommentStart && !escaped) 138tokenBuffer.Append(input[i]); 141else if (!Char.IsWhiteSpace(input[i])) 150if (input[i] == CommentEnd) 163tokenBuffer.Append(input[i]); 167else if (input[i] == CommentStart && !escaped) 175if (input[i] == EscapeChar && !escaped) 181tokenBuffer.Append(input[i]); 213if (Char.IsWhiteSpace(input[i])) 227builder.Append(input[i]);
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\MarkupExtensionParser.cs (32)
357if (Char.IsWhiteSpace(attrValue[i])) 371if (!gotEscape && attrValue[i] == '\\') 376else if (attrValue[i] == '}') 392stringBuilder.Append(attrValue[i]); 399if (!gotEscape && attrValue[i] == '\\') 403else if (attrValue[i] == '}') 411stringBuilder.Append(attrValue[i]); 429else if( attrValue[length-1] == '}') 961if (!gotEscape && args[i] == '\\') 967if (!nonWhitespaceFound && !Char.IsWhiteSpace(args[i])) 995stringBuilder.Append(args[i]); 1004if (inQuotes && args[i] == quoteChar) 1016if (leftCurlies > 0 && args[i] == '}') 1020else if (args[i] == '{') 1024stringBuilder.Append(args[i]); 1031stringBuilder.Append(args[i]); 1032if (bracketCharacters.StartsEscapeSequence(args[i])) 1034bracketCharacterStack.Push(args[i]); 1036else if (bracketCharacters.EndsEscapeSequence(args[i])) 1038if (bracketCharacters.Match(bracketCharacterStack.Peek(), args[i])) 1044ThrowException(nameof(SR.ParserMarkupExtensionInvalidClosingBracketCharacers), args[i].ToString(), lineNumber, linePosition); 1055switch(args[i]) 1067quoteChar = args[i]; 1072if (inCtorParsingMode && args[i] == ',') 1106if (args[i] == '=') 1115list.Add(args[i]); 1140stringBuilder.Append(args[i]); 1144if (bracketCharacters != null && bracketCharacters.StartsEscapeSequence(args[i])) 1147bracketCharacterStack.Push(args[i]); 1152stringBuilder.Append(args[i]); 1618if (noEscape && value[i] == '\\') 1629builder.Append(value[i]);
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\StyleXamlParser.cs (1)
1183if (!XamlReaderHelper.IsWhiteSpace(xamlTextNode.Text[i]))
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\TemplateXamlParser.cs (1)
1314if (!XamlReaderHelper.IsWhiteSpace(xamlTextNode.Text[i]))
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\XamlReaderHelper.cs (13)
2431char c = _text[current++]; 2437if (_text[current++] == '\0') 2444c = _text[current++]; 2452if (_text[current++] == '\0') 2471c = _text[current++]; 5464if (!IsWhiteSpace(text[index])) 5481if (!IsWhiteSpace(text[i])) 5505char highChar = s[index]; 5508char lowChar = s[index + 1]; 5522unicodeScalarValue = isPrevious ? s[index + 1] : highChar; 5582char currentChar = text[textIndex]; 5638char prevChar = text[textIndex - 1]; 5676if (IsWhiteSpace(text[textLength - 1]))
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\XamlTypeMapper.cs (4)
724if (!Char.IsWhiteSpace(attribValue[i])) 728if (attribValue[i] == ',') 733else if (Char.IsDigit(attribValue[i])) 3618Char.IsWhiteSpace(keyString[keyString.Length-1])))
src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\TokenizerHelper.cs (4)
169char currentChar = _str[_charIndex]; 192currentChar = _str[_charIndex]; 252char currentChar = _str[_charIndex]; 268currentChar = _str[_charIndex];
src\Microsoft.DotNet.Wpf\src\Shared\System\Windows\Markup\RuntimeIdentifierPropertyAttribute.cs (2)
98uc = Char.GetUnicodeCategory(name[i]); 104name[i] == '_');
PresentationCore (54)
MS\Internal\FontCache\DWriteFactory.cs (1)
71if (string.Equals((localPath.Length > 0 && localPath[localPath.Length - 1] != Path.DirectorySeparatorChar) ? localPath + Path.DirectorySeparatorChar : localPath, Util.WindowsFontsUriObject.LocalPath, StringComparison.OrdinalIgnoreCase))
MS\Internal\FontCache\FontCacheUtil.cs (4)
456while (i < length && s[i] == '.') 460while (i < length && char.IsWhiteSpace(s[i])) 722int result = CompareOrdinalIgnoreCase(a[i], b[i]);
MS\Internal\FontCache\FontResourceCache.cs (1)
100return path.Length == 0 || path[path.Length - 1] == '/';
MS\Internal\FontCache\FontSourceCollection.cs (1)
74_isFileSystemFolder = localPath[localPath.Length - 1] == Path.DirectorySeparatorChar;
MS\Internal\FontFace\FontFamilyIdentifier.cs (5)
296while (i < length && char.IsWhiteSpace(friendlyName[i])) 304if (friendlyName[i] == FamilyNameDelimiter) 306if (i + 1 < length && friendlyName[i + 1] == FamilyNameDelimiter) 316else if (friendlyName[i] == '\0') 328while (end > begin && char.IsWhiteSpace(friendlyName[end - 1]))
MS\Internal\TextFormatting\TextMarkerSource.cs (2)
276result[0] = numericSymbols[number]; 303result[i] = numericSymbols[number % b];
src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\CharacterBuffer.cs (1)
285get { return _string[characterOffset]; }
System\Windows\Markup\XamlSerializerUtil.cs (1)
54if (!Char.IsWhiteSpace(s[i]))
System\Windows\Markup\XmlLanguage.cs (4)
440if (languageTag[i] == '-') 630return (prefix.Length == 0 || prefix.Length == longTag.Length || longTag[prefix.Length] == '-'); 679while (languageTag[i] != '-' && i > 0) 802if (tag[i] > 127)
System\Windows\Media\Animation\KeyTimeConverter.cs (1)
82else if (stringValue[stringValue.Length - 1] == '%')
System\Windows\Media\Animation\RepeatBehaviorConverter.cs (1)
80&& stringValue[stringValue.Length - 1] == _iterationCharacter)
System\Windows\Media\CharacterMetrics.cs (3)
141while (i < s.Length && s[i] == ' ') 146while (j < s.Length && s[j] != ',') 151while (k > i && s[k - 1] == ' ')
System\Windows\Media\FamilyMap.cs (7)
240if (unicodeRanges[index] == '?') 249unicodeRanges[index] == '?' && 252else if (unicodeRanges[index] == '-') 264(index<unicodeRanges.Length && unicodeRanges[index] !=',')) 282while (index<numString.Length && numString[index] == ' ') 293int n = (int) numString[index]; 316while (index < numString.Length && numString[index] == ' ')
System\Windows\Media\ParsersCommon.cs (22)
122if (pathString[curIndex] == 'F') 135((pathString[curIndex] != '0') && 136(pathString[curIndex] != '1'))) 142fillRule = pathString[curIndex] == '0' ? FillRule.EvenOdd : FillRule.Nonzero; 210char ch = _pathString[_curIndex]; 258_token = _pathString[_curIndex ++]; 274_token = _pathString[_curIndex]; 296if (signAllowed && More() && ((_pathString[_curIndex] == '-') || _pathString[_curIndex] == '+')) 301while (More() && (_pathString[_curIndex] >= '0') && (_pathString[_curIndex] <= '9')) 352if (More() && ((_pathString[_curIndex] == '-') || _pathString[_curIndex] == '+')) 358if (More() && (_pathString[_curIndex] == 'I')) 368else if (More() && (_pathString[_curIndex] == 'N')) 382if (More() && (_pathString[_curIndex] == '.')) 390if (More() && ((_pathString[_curIndex] == 'E') || (_pathString[_curIndex] == 'e'))) 402if (_pathString[start] == '+') 406else if (_pathString[start] == '-') 416value = value * 10 + (_pathString[start] - '0'); 449_token = _pathString[_curIndex ++];
PresentationFramework (210)
MS\Internal\Data\PathParser.cs (6)
104char c = (_index < _n) ? _path[_index] : NullChar; 173while (_index < _n && _path[_index] == '.') 176while (_index < _n && (level > 0 || !IsSpecialChar(_path[_index]))) 178if (_path[_index] == '(') 180else if (_path[_index] == ')') 238char c = _path[_index++];
MS\Internal\Data\XmlBindingWorker.cs (2)
577char c = xpath[index]; 586c = xpath[index];
MS\Internal\Globalization\BamlResourceContent.cs (7)
31switch (content[i]) 38builder.Append(content[i]); 68builder.Append(content[i]); 194if (input[i] == BamlConst.ChildStart) 196if (i == 0 || input[i - 1] != BamlConst.EscapeChar) 217else if (input[i] == BamlConst.ChildEnd) 220&& input[i - 1] != BamlConst.EscapeChar
MS\Internal\Globalization\LocalizationComments.cs (14)
91if (Char.IsWhiteSpace(input[i]) && !escaped) 104if (input[i] == CommentStart && !escaped) 119else if (input[i] == EscapeChar && !escaped) 125tokenBuffer.Append(input[i]); 135if (input[i] == CommentStart && !escaped) 138tokenBuffer.Append(input[i]); 141else if (!Char.IsWhiteSpace(input[i])) 150if (input[i] == CommentEnd) 163tokenBuffer.Append(input[i]); 167else if (input[i] == CommentStart && !escaped) 175if (input[i] == EscapeChar && !escaped) 181tokenBuffer.Append(input[i]); 213if (Char.IsWhiteSpace(input[i])) 227builder.Append(input[i]);
MS\Internal\PtsHost\ListMarkerSourceInfo.cs (2)
165numericSymbols[number], 195result[i] = state.numericSymbols[remainder];
System\Windows\Controls\AccessText.cs (1)
669if (index + 1 < lenght && text[index + 1] != AccessKeyMarker)
System\Windows\Controls\DataGridClipboardHelper.cs (2)
122char ch = s[i]; 185char ch = s[i];
System\Windows\Controls\DataGridHelper.cs (1)
731if (text[i] != _escapeChar)
System\Windows\Controls\DefinitionBase.cs (3)
558bool isDigit = Char.IsDigit(id[i]); 562|| Char.IsLetter(id[i]) 563|| '_' == id[i] ) )
System\Windows\Controls\PasswordBox.cs (1)
183securePassword.AppendChar(value[i]);
System\Windows\Controls\PasswordTextContainer.cs (1)
84_password.InsertAt(offset + i, textData[i]);
System\Windows\Controls\TextBox.cs (9)
1711if (oldText[prefix] != newText[prefix]) 1718if (oldText[oldText.Length - 1 - suffix ] != newText[newText.Length - 1 - suffix]) 1737char anchor = oldText[oldIndex - 1]; 1751if (newText[index] != oldText[oldIndex - (anchorIndex - index)]) 1761if (newText[index] != oldText[oldIndex + (index - anchorIndex)])
System\Windows\Documents\FixedSOMPageConstructor.cs (1)
468if ((charIndex == 0 || s[charIndex-1] == ' ') && (charIndex != s.Length - 1))
System\Windows\Documents\FixedSOMTextRun.cs (2)
158destination[i] = runText[runText.Length - 1 - i]; 172if (!Char.IsWhiteSpace(s[i]))
System\Windows\Documents\FixedTextBuilder.cs (2)
670char lastChar = strPrev[textLength - 1]; 1664if (addSpace && run.Text.Length>0 && !run.Text.EndsWith(" ", StringComparison.Ordinal) && !IsHyphen(run.Text[run.Text.Length - 1]))
System\Windows\Documents\Glyphs.cs (3)
536char c = i < glyphsProp.Length ? glyphsProp[i] : '\0'; 565parsedGlyphData.glyphIndex = GetGlyphFromCharacter(fontFace, unicodeString[parsedCharacterCount]); 660parsedGlyphData.glyphIndex = GetGlyphFromCharacter(fontFace, unicodeString[parsedCharacterCount]);
System\Windows\Documents\RtfToXamlReader.cs (45)
3402if (rgChars[k] != Name[k]) 3658while (iCP > 0 && entry.Name[iCP - 1] == ' ') 4912if ((text[i] & 0xF800) == 0xD800) // if surrogate 4915|| ((text[i] & 0xFC00) == 0xDC00) // or low surrogate occurs before high 4916|| ((text[i + 1] & 0xFC00) != 0xDC00) // or high not followed by low 4962if (text[currentIndex] < 32 4963&& text[currentIndex] != '\t') 4967if (text[currentIndex] == '&' 4968|| text[currentIndex] == '>' 4969|| text[currentIndex] == '<' 4970|| text[currentIndex] == 0) 4984if (text[currentIndex] < 32 && text[currentIndex] != '\t') 4986switch (text[currentIndex]) 4990int ic = (int)text[currentIndex]; 5002switch (text[currentIndex]) 8368if (instr[i] == ' ') 8374else if (instr[i] == '"') 8384if (instr[iEnd] == '"') 8410else if (instr[i] == '\\') 8415switch (instr[i]) 8474if (instr[i] == ' ') 8479else if (nChar == -1 && instr[i] >= '0' && instr[i] <= '9') 8482if (instr[i] == '0' && i < instr.Length - 1 && instr[i + 1] == 'x') 8487for (; i < instr.Length && instr[i] != ' ' && instr[i] != '\\'; i++) 8491nChar = (nChar * 16) + HexToInt(instr[i]); 8498for (; i < instr.Length && instr[i] != ' ' && instr[i] != '\\'; i++) 8502nChar = (nChar * 10) + DecToInt(instr[i]); 8508else if (instr[i] == '\\') 8538switch (instr[i++]) 8553if (i < instr.Length && instr[i] == ' ') 8557for (; i < instr.Length && instr[i] != ' '; i++) 8587if (i < instr.Length && instr[i] == ' ') 8591if (i < instr.Length && instr[i] == '"') 8596for (; i < instr.Length && instr[i] != '"'; i++) 11347if (text[nEnd] == 0x0d || text[nEnd] == 0x0a) 11366while (nEnd < text.Length && (text[nEnd] == 0x0d || text[nEnd] == 0x0a)) 11370if (nEnd + 1 < text.Length && text[nEnd] == 0x0d && text[nEnd] == 0x0a)
System\windows\Documents\TextEditor.cs (2)
1445if ((text[position - 1] == '\r' && text[position] == '\n')
System\windows\Documents\TextEditorCopyPaste.cs (4)
958if (pastedText[i] == '\r' || pastedText[i] == '\n') 979if (pastedText[i] == '\r' && i + 1 < pastedText.Length && pastedText[i + 1] == '\n')
System\windows\Documents\TextEditorSpelling.cs (1)
354isSelectionIgnoringErrors = TextPointerBase.IsCharUnicodeNewLine(text[i]);
System\windows\Documents\TextEditorTyping.cs (1)
1517if (Char.IsControl(textData[i]))
System\Windows\Documents\TextFindEngine.cs (6)
111SafeNativeMethods.GetStringTypeEx(0 /* ignored */, SafeNativeMethods.CT_CTYPE1, [findPattern[findPattern.Length - 1]], new Span<UInt16>(ref endCharType1)); 785char currentChar = textString[index]; 832if (IsSeparatorChar(textString[matchIndex + matchLength])) 845if (IsSeparatorChar(textString[matchIndex - 1]) && hasFollowingSeparatorChar) 852if (IsSeparatorChar(textString[matchIndex - 1]) && IsSeparatorChar(textString[matchIndex + matchLength]))
System\Windows\Documents\TextRangeBase.cs (2)
1029result[0] = numericSymbols[number]; 1052result[i] = numericSymbols[number % b];
System\windows\Documents\TextSelection.cs (1)
2483if ((fontSignature[FONTSIGNATURE_BIDI_INDEX] & FONTSIGNATURE_BIDI) != 0)
System\Windows\Documents\XamlToRtfParser.cs (34)
275char tokenChar = _xaml[_xamlIndex]; 285for (_xamlIndex++; IsCharsAvailable(1) && IsSpace(_xaml[_xamlIndex]); _xamlIndex++) 301if (_xaml[_xamlIndex] == ';') 316if (_xaml[_xamlIndex] == '&' || _xaml[_xamlIndex] == '<') 370char currentChar = _xaml[_xamlIndex]; 378if (_xaml[_xamlIndex] == '?' && _xaml[_xamlIndex + 1] == '>') 393if (_xaml[_xamlIndex] == '-' && _xaml[_xamlIndex + 1] == '-' && _xaml[_xamlIndex + 2] == '>') 412if (_xaml[_xamlIndex] == '>') 432if (_xaml[_xamlIndex] == quoteChar) 437else if (_xaml[_xamlIndex] == '"' || _xaml[_xamlIndex] == '\'') 439quoteChar = _xaml[_xamlIndex]; 441else if (_xaml[_xamlIndex] == '>') 780if (xaml.Length < 2 || xaml[0] != '<' || xaml[xaml.Length - 1] != '>') 787if (IsSpace(xaml[xamlIndex])) 793if (xaml[xamlIndex] == '/') 803for (xamlIndex++; IsNameChar(xaml[xamlIndex]); xamlIndex++) 814for (; IsSpace(xaml[xamlIndex]); xamlIndex++) 826if (xaml[xamlIndex] == '/') 843for (xamlIndex++; IsNameChar(xaml[xamlIndex]); xamlIndex++) 853for (; IsSpace(xaml[xamlIndex]); xamlIndex++) 860if (xamlIndex == xaml.Length || xaml[xamlIndex] != '=') 868for (; IsSpace(xaml[xamlIndex]); xamlIndex++) 874if (xaml[xamlIndex] != '\'' && xaml[xamlIndex] != '"') 879quoteChar = xaml[xamlIndex++]; 884for (; xamlIndex < xaml.Length && xaml[xamlIndex] != quoteChar; xamlIndex++) 961for (; IsSpace(xaml[xamlIndex]); xamlIndex++) 970for (xamlIndex++; IsNameChar(xaml[xamlIndex]); xamlIndex++) 978for (; IsSpace(xaml[xamlIndex]); xamlIndex++)
System\Windows\Documents\XamlToRtfWriter.cs (10)
843if (documentNode.NavigateUri[i] == '\\') 849_rtfBuilder.Append(documentNode.NavigateUri[i]); 2445while (index < characters.Length && IsNewLine(characters[index])) 2452while (end < characters.Length && !IsNewLine(characters[end])) 2632if (xaml[iEnd] == '\r' || xaml[iEnd] == '\n') 2634if (xaml[iEnd] == '\r' && iEnd + 1 < xaml.Length && xaml[iEnd + 1] == '\n') 3614char colorChar = brush[brushStringIndex]; 3902AppendRtfChar(sb, s[i], cp, ref e, rgAnsi, rgChar);
System\Windows\Markup\Baml2006\Baml2006Reader.cs (1)
1010if (!Char.IsWhiteSpace(value[i]))
System\Windows\Markup\Baml2006\WpfGeneratedKnownProperties.cs (1)
296result = 101 * result + (uint)typeName[i];
System\Windows\Markup\Baml2006\WpfGeneratedKnownTypes.cs (1)
787result = 101 * result + (uint)typeName[i];
System\Windows\Markup\BamlReader.cs (3)
1760if (value[i] == '{' || value[i] == '}') 1769builder?.Append(value[i]);
System\Windows\Markup\MarkupExtensionParser.cs (32)
357if (Char.IsWhiteSpace(attrValue[i])) 371if (!gotEscape && attrValue[i] == '\\') 376else if (attrValue[i] == '}') 392stringBuilder.Append(attrValue[i]); 399if (!gotEscape && attrValue[i] == '\\') 403else if (attrValue[i] == '}') 411stringBuilder.Append(attrValue[i]); 429else if( attrValue[length-1] == '}') 961if (!gotEscape && args[i] == '\\') 967if (!nonWhitespaceFound && !Char.IsWhiteSpace(args[i])) 995stringBuilder.Append(args[i]); 1004if (inQuotes && args[i] == quoteChar) 1016if (leftCurlies > 0 && args[i] == '}') 1020else if (args[i] == '{') 1024stringBuilder.Append(args[i]); 1031stringBuilder.Append(args[i]); 1032if (bracketCharacters.StartsEscapeSequence(args[i])) 1034bracketCharacterStack.Push(args[i]); 1036else if (bracketCharacters.EndsEscapeSequence(args[i])) 1038if (bracketCharacters.Match(bracketCharacterStack.Peek(), args[i])) 1044ThrowException(nameof(SR.ParserMarkupExtensionInvalidClosingBracketCharacers), args[i].ToString(), lineNumber, linePosition); 1055switch(args[i]) 1067quoteChar = args[i]; 1072if (inCtorParsingMode && args[i] == ',') 1106if (args[i] == '=') 1115list.Add(args[i]); 1140stringBuilder.Append(args[i]); 1144if (bracketCharacters != null && bracketCharacters.StartsEscapeSequence(args[i])) 1147bracketCharacterStack.Push(args[i]); 1152stringBuilder.Append(args[i]); 1618if (noEscape && value[i] == '\\') 1629builder.Append(value[i]);
System\Windows\Markup\Primitives\MarkupWriter.cs (1)
1242char currentChar = value[textIndex];
System\Windows\Markup\XamlSerializerUtil.cs (1)
37if (!Char.IsWhiteSpace(s[i]))
System\Windows\Markup\XamlTypeMapper.cs (4)
724if (!Char.IsWhiteSpace(attribValue[i])) 728if (attribValue[i] == ',') 733else if (Char.IsDigit(attribValue[i])) 3618Char.IsWhiteSpace(keyString[keyString.Length-1])))
System\Windows\PropertyPath.cs (1)
900return (name != null && name.Length > 1 && name[0] == '(' && (name[name.Length - 1] == ')'));
System\Windows\PropertyPathConverter.cs (2)
172if (originalPath[i] == '(') 177if (originalPath[j] == ')')
ReachFramework (2)
MS\Internal\Printing\Configuration\DevMode.cs (2)
634WriteUTF16Char(byteOffset, charsWritten, value[charsWritten]); 648WriteAsciiChar(byteOffset, charsWritten, value[charsWritten]);
Roslyn.Diagnostics.Analyzers (112)
src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (12)
53while (lastSeparator > 0 && IsDirectorySeparator(s[lastSeparator - 1])) 71if (s.Length == 0 || IsAnyDirectorySeparator(s[s.Length - 1])) 145if (IsDirectorySeparator(path[i])) 147if (i > 0 && IsDirectorySeparator(path[i - 1])) 240if (!IsDirectorySeparator(path[i])) 276while (i < length && IsDirectorySeparator(path[i])) 440char c = root[root.Length - 1]; 479if (path.Length > 0 && IsDirectorySeparator(path[path.Length - 1])) 611&& (IsDirectorySeparator(parentPath[parentPath.Length - 1]) || IsDirectorySeparator(childPath[parentPath.Length])); 663if (!PathCharEqual(path1[i], path2[i]))
src\Compilers\Core\Portable\InternalUtilities\FileNameUtilities.cs (2)
122if (path.Length > 0 && path[path.Length - 1] == '.') 175char ch = path[i];
src\Compilers\Core\Portable\InternalUtilities\StringExtensions.cs (7)
173char c = str[i++]; 178if (i < str.Length && char.IsLowSurrogate(str[i])) 208if (arg.Length > 1 && arg[0] == '"' && arg[arg.Length - 1] == '"') 224char.ToUpper(string1[x]) == char.ToUpper(string2[x])) 236string1[x] == string2[x])
src\Compilers\Core\Portable\InternalUtilities\StringTable.cs (4)
489if (array[i] != text[start + i]) 519if (array[i] != text[i]) 545if (ascii[i] != text[i])
src\Compilers\Core\Portable\InternalUtilities\UnicodeCharacterUtilities.cs (1)
106if (!IsIdentifierPartCharacter(name[i]))
src\Compilers\Core\Portable\Syntax\SyntaxTreeExtensions.cs (4)
65found = fromNode[index]; 66expected = fromText[index]; 100if (s1[i] != s2[i])
src\RoslynAnalyzers\Utilities\Compiler\Options\AnalyzerOptionsExtensions.cs (1)
365if (trimmedSuffix[i] != ' ')
src\RoslynAnalyzers\Utilities\Compiler\WellKnownTypeProvider.cs (2)
222if (fullTypeName[i] == '.') 227else if (!IsIdentifierPartCharacter(fullTypeName[i]))
src\RoslynAnalyzers\Utilities\Compiler\WordParser.cs (2)
558char c = _text[_index++]; 576char c = _text[index];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher.Lexer.cs (6)
26if (headerText[Position] == '\\') 80switch (headerText[position]) 86headerText[position] == '*') 124public readonly char CurrentCharacter => headerText[Position]; 126public char EatCurrentCharacter() => headerText[Position++]; 142public readonly char this[int position] => headerText[position];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\AbstractVirtualCharService.cs (6)
33var ch = tokenText[index]; 34var next = tokenText[index + 1]; 165if (tokenText[index] == '"' && tokenText[index + 1] == '"') 171else if (escapeBraces && IsOpenOrCloseBrace(tokenText[index])) 176result.Add(VirtualChar.Create(new Rune(tokenText[index]), span));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\AbstractVirtualCharService.ITextInfo.cs (1)
29public readonly char Get(string text, int index) => text[index];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\VirtualCharSequence.Chunks.cs (3)
102if (char.IsHighSurrogate(data[index])) 105!char.IsLowSurrogate(data[index + 1])); 110var ch = data[index];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\StringExtensions.cs (8)
20if (!char.IsWhiteSpace(line[i])) 35if (!char.IsWhiteSpace(line[i])) 87if (textSnippet[i] == '\t') 109if (predicate(text[i])) 158if (text[i] == '\n') 162else if (text[i] == '\r') 164if (i + 1 == text.Length || text[i + 1] != '\n') 230if (line[i] == '\t')
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\FormattingExtensions.cs (3)
228if (text[i] is not ' ' and not '\t') 245if (i >= newText.Length || text[i] != newText[i])
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\TriviaEngine\AbstractTriviaFormatter.cs (5)
147if (!IsWhitespace(text[i]) || !IsNewLine(text[i])) 503if (!char.IsWhiteSpace(this.OriginalString[i])) 533if (!IsWhitespace(this.OriginalString[i])) 743if (this.OriginalString[i] == '\n')
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.cs (11)
180private static readonly Func<string, TextSpan, bool> s_firstCharIsLowerCase = (val, span) => !DoesCharacterHaveCasing(val[span.Start]) || char.IsLower(val[span.Start]); 181private static readonly Func<string, TextSpan, bool> s_firstCharIsUpperCase = (val, span) => !DoesCharacterHaveCasing(val[span.Start]) || char.IsUpper(val[span.Start]); 187if (DoesCharacterHaveCasing(val[i]) && !char.IsUpper(val[i])) 200if (DoesCharacterHaveCasing(val[i]) && !char.IsLower(val[i])) 348switch (char.ToLowerInvariant(name[index])) 353if (index + 2 < name.Length && name[index + 1] == '_') 362if (index + 1 < name.Length && !char.IsDigit(name[index + 1]))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\ISyntaxFactsExtensions.cs (1)
263if (!syntaxFacts.IsIdentifierPartCharacter(name[i]))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (16)
65Debug.Assert(Data[Position] == c); 87Debug.Assert(char.IsNumber(Data[Position])); 92while (char.IsNumber(Data[Position])) 94var digit = Data[Position] - '0'; 139if ((SymbolKeyType)Data[Position] == SymbolKeyType.Null) 152if (Data[Position] != DoubleQuoteChar) 160if (Data[Position + 1] == DoubleQuoteChar) 202Debug.Assert((SymbolKeyType)Data[Position] != SymbolKeyType.Null); 261var ch = Data[Position]; 266var type = (SymbolKeyType)Data[Position]; 272else if (Data[Position] == DoubleQuoteChar) 306_builder.Append(Data[i]); 474var type = (SymbolKeyType)Data[Position]; 485type = (SymbolKeyType)Data[Position]; 547Debug.Assert((SymbolKeyType)Data[Position] != SymbolKeyType.Null); 646if ((SymbolKeyType)Data[Position] == SymbolKeyType.Null)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\Base64Utilities.cs (1)
338while (index >= 0 && attributeData[index] == '=')
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BKTree.cs (1)
79lowerCaseCharacters[i] = CaseInsensitiveComparison.ToLower(value[i]);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EditDistance.cs (2)
62array[i] = CaseInsensitiveComparison.ToLower(text[i]); 94targetLowerCaseCharacters[i] = CaseInsensitiveComparison.ToLower(target[i]);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\StringBreaker.cs (9)
46var firstChar = identifier[wordStart]; 86var c = identifier[current]; 108var c = identifier[current]; 118while (current < length && char.IsUpper(identifier[current])) 123if (current < length && IsLower(identifier[current])) 126Debug.Assert(char.IsUpper(identifier[current - 1])); 153while (current < length && IsLower(identifier[current])) 164while (current < length && char.IsDigit(identifier[current])) 176var ch = identifier[wordStart];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\StringEscapeEncoder.cs (2)
46builder.AppendFormat("{0:X2}", (int)text[index]); 105var ch = text[i];
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (1)
373if (p.Length > 0 && char.IsLetter(name[p.Start]))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\TypeInferenceService\AbstractTypeInferenceService.cs (1)
72var nextChar = name[prefix.Length];
Roslyn.Diagnostics.CSharp.Analyzers (22)
NumberCommentsRefactoring.cs (5)
138var current = comment[i]; 145if (i + 1 < length && comment[i + 1] == '\n') 162var current = comment[index]; 168if (current == '/' && comment[index - 1] == '/' && comment[index - 2] == ' ')
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\EmbeddedLanguages\VirtualChars\CSharpVirtualCharService.cs (15)
149while (tokenText[startIndexInclusive] == '"') 152Contract.ThrowIfFalse(tokenText[endIndexExclusive - 1] == '"'); 259var ch = tokenText[index]; 342Debug.Assert(tokenText[index] == '\\'); 355Debug.Assert(tokenText[index] == '\\'); 357var ch = tokenText[index + 1]; 389Debug.Assert(tokenText[index] == '\\'); 391var ch = tokenText[index + 1]; 408Debug.Assert(tokenText[index] == '\\'); 417if (!IsHexDigit(tokenText[index])) 425character = tokenText[index + i]; 469if (!IsHexDigit(tokenText[index])) 477var ch2 = tokenText[index + i]; 497if (!IsHexDigit(tokenText[index])) 506var ch2 = tokenText[index + i];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\Trivia\TriviaDataFactory.Analyzer.cs (2)
165if (text[i] == ' ') 169else if (text[i] == '\t')
Roslyn.Test.PdbUtilities (1)
Reader\MockSymUnmanagedReader.cs (1)
365name[i] = _name[i];
Sockets.BindTests (1)
src\Servers\Kestrel\shared\test\StreamBackedTestConnection.cs (1)
83var ch = text[index];
Sockets.FunctionalTests (1)
src\Servers\Kestrel\shared\test\StreamBackedTestConnection.cs (1)
83var ch = text[index];
Swaggatherer (3)
src\Shared\CommandLineUtils\CommandLine\AnsiConsole.cs (3)
78message[endIndex] >= 0x20 && 79message[endIndex] <= 0x3f) 91switch (message[endIndex])
System.CodeDom (61)
Microsoft\CSharp\CSharpCodeGenerator.cs (21)
103switch (value[i]) 129AppendEscapedChar(b, value[i]); 133b.Append(value[i]); 143if (char.IsHighSurrogate(value[i]) && (i < value.Length - 1) && char.IsLowSurrogate(value[i + 1])) 179if (value[i] == '\"') 182b.Append(value[i]); 871if (value[i] == '/' && (e.DocComment || !value.HasCharAt(i + 1, '/'))) 878if (value[i] == '\u0000') 882Output.Write(value[i]); 884if (value[i] == '\r') 895else if (value[i] == '\n') 901else if (value[i] == '\u2028' || value[i] == '\u2029' || value[i] == '\u0085') 2776switch (baseType[i]) 2790while (i < baseType.Length && baseType[i] >= '0' && baseType[i] <= '9') 2792numTypeArgs = numTypeArgs * 10 + (baseType[i] - '0'); 2801if (i < baseType.Length && (baseType[i] == '+' || baseType[i] == '.'))
Microsoft\VisualBasic\VBCodeGenerator.cs (19)
297char ch = value[i]; 313if (i < value.Length - 1 && value[i + 1] == '\n') 342b.Append(value[i]); 352if (char.IsHighSurrogate(value[i]) 354&& char.IsLowSurrogate(value[i + 1])) 1239if (value[i] == '\'' && (e.DocComment || (value.HasCharAt(i + 1, '\'') && !value.HasCharAt(i + 2, '\'')))) 1246Output.Write(value[i]); 1248if (value[i] == '\r') 1259else if (value[i] == '\n') 1265else if (value[i] == '\u2028' || value[i] == '\u2029' || value[i] == '\u0085') 2388if (value[0] != '[' || value[value.Length - 1] != ']') 2485switch (baseType[i]) 2499while (i < baseType.Length && baseType[i] >= '0' && baseType[i] <= '9') 2501numTypeArgs = numTypeArgs * 10 + (baseType[i] - '0'); 2510if (i < baseType.Length && (baseType[i] == '+' || baseType[i] == '.'))
src\libraries\Common\src\System\CodeDom\CodeTypeReference.cs (13)
145if (typeName[current--] == ']') 147while (current >= 0 && typeName[current] == ',') 153if (current >= 0 && typeName[current] == '[') 169if (current > 0 && typeName[current--] == ']') 178if (typeName[current] == '[') 183else if (typeName[current] == ']') 187else if (typeName[current] == ',' && unmatchedRightBrackets == 1) 371while (start < typeName.Length && char.IsWhiteSpace(typeName[start])) start++; 372while (end >= 0 && char.IsWhiteSpace(typeName[end])) end--; 376if (typeName[start] == '[' && typeName[end] == ']') 383if (typeName[end] != ']') 388if (typeName[index] == ',')
src\libraries\Common\src\System\CSharpHelpers.cs (1)
154char ch = value[i];
StringExtensions.cs (1)
10return index < value.Length && value[index] == character;
System\CodeDom\Compiler\CodeValidator.cs (4)
624if (baseType[i] == '`') 628while (i < baseType.Length && baseType[i] >= '0' && baseType[i] <= '9') 630numTypeArgs = numTypeArgs * 10 + (baseType[i] - '0');
System\Collections\Specialized\FixedStringLookup.cs (2)
46searchChar = char.ToLowerInvariant(value[pos]); 50searchChar = value[pos];
System.Collections.Immutable (4)
System\Collections\Frozen\String\OrdinalStringFrozenDictionary_LeftJustifiedSingleChar.cs (1)
26private protected override int GetHashCode(string s) => s[HashIndex];
System\Collections\Frozen\String\OrdinalStringFrozenDictionary_RightJustifiedSingleChar.cs (1)
26private protected override int GetHashCode(string s) => s[s.Length + HashIndex];
System\Collections\Frozen\String\OrdinalStringFrozenSet_LeftJustifiedSingleChar.cs (1)
23private protected override int GetHashCode(string s) => s[HashIndex];
System\Collections\Frozen\String\OrdinalStringFrozenSet_RightJustifiedSingleChar.cs (1)
23private protected override int GetHashCode(string s) => s[s.Length + HashIndex];
System.ComponentModel.Annotations (1)
System\ComponentModel\DataAnnotations\CreditCardAttribute.cs (1)
34char digit = ccValue[i];
System.ComponentModel.TypeConverter (5)
src\libraries\Common\src\System\Drawing\ColorConverterCommon.cs (1)
41if (text.Length >= 2 && (text[0] == '\'' || text[0] == '"') && text[0] == text[text.Length - 1])
System\ComponentModel\ComponentResourceManager.cs (2)
161if (key.Length <= idx || (key[idx] != '.' && key[idx] != '-'))
System\ComponentModel\MaskedTextProvider.cs (2)
307ch = Mask[maskPos]; 2229switch (Mask[charDex.MaskPosition])
System.Configuration.ConfigurationManager (19)
System\Configuration\AppSettingsReader.cs (2)
83while (val[count] == '(' && val[len - count - 1] == ')')
System\Configuration\BaseConfigurationRecord.cs (1)
3095if (InvalidLastSubPathCharacters.IndexOf(subPath[subPath.Length - 1]) != -1)
System\Configuration\ConfigPathUtility.cs (4)
30ch = examine < configPath.Length ? configPath[examine] : SeparatorChar; 44if ((examine == start + 2) && (configPath[start + 1] == '.')) 48if ((examine == start + 3) && (configPath[start + 1] == '.') && (configPath[start + 2] == '.'))
System\Configuration\GenericEnumConverter.cs (1)
34(!char.IsWhiteSpace(value[0])) && (!char.IsWhiteSpace(value[value.Length - 1])))
System\Configuration\UrlPath.cs (9)
31if (dir[lDir - 1] == '\\' || dir[lDir - 1] == '/') lDir -= 1; 34if (subdir[lSubdir - 1] == '\\' || dir[lDir - 1] == '/') lSubdir -= 1; 43return (lSubdir <= lDir) || (subdir[lDir] == '\\') || (subdir[lDir] == '/'); 76if (path[lPath - 1] == '/') lPath -= 1; 79if (subpath[lSubpath - 1] == '/') lSubpath -= 1; 91return (lSubpath <= lPath) || (subpath[lPath] == '/');
System\Configuration\XmlUtilWriter.cs (2)
90char ch = s[i]; 126char ch = s[i];
System.Data.Common (19)
src\libraries\Common\src\System\Data\Common\DbConnectionOptions.Common.cs (2)
216currentChar = connectionString[currentPosition]; 375char tmpChar = keyvalue[keyvalue.Length - 1];
src\libraries\Common\src\System\Data\Common\MultipartIdentifier.cs (2)
85char testchar = name[index]; 105rightQuoteChar = rightQuote[quoteIndex]; // record the corresponding right quote for the left quote
System\Data\DataTable.cs (5)
2945if (s1[leng1 - 1] != 0x20 && s1[leng1 - 1] != 0x3000) // 0x3000 is Ideographic Whitespace 2952if (s2[leng2 - 1] != 0x20 && s2[leng2 - 1] != 0x3000) 3216for (i = 0; (i < name.Length) && (0x3000 > name[i]); ++i) ;
System\Data\SQLTypes\SQLString.cs (10)
396while (cwchX > 0 && rgchX[cwchX - 1] == ' ') 398while (cwchY > 0 && rgchY[cwchY - 1] == ' ') 786if (rgDataX[i] < rgDataY[i]) 788else if (rgDataX[i] > rgDataY[i]) 801if (rgDataY[i] != chSpace) 802return (chSpace > rgDataY[i]) ? 1 : -1; 809if (rgDataX[i] != chSpace) 810return (rgDataX[i] > chSpace) ? 1 : -1;
System.Data.Odbc (22)
Common\System\Data\Common\DbConnectionOptions.cs (2)
292bool rootFolderEndsWith = (0 < rootFolderPath.Length) && rootFolderPath[rootFolderPath.Length - 1] == '\\'; 293bool fileNameStartsWith = (fileNamePosition < value.Length) && value[fileNamePosition] == '\\';
src\libraries\Common\src\System\Data\Common\DbConnectionOptions.Common.cs (2)
216currentChar = connectionString[currentPosition]; 375char tmpChar = keyvalue[keyvalue.Length - 1];
src\libraries\Common\src\System\Data\Common\MultipartIdentifier.cs (2)
85char testchar = name[index]; 105rightQuoteChar = rightQuote[quoteIndex]; // record the corresponding right quote for the left quote
System\Data\Odbc\OdbcDataReader.cs (2)
2852Debug.Assert(str[str.Length - 1] == quoteChar, "Missing quote at end of string that begins with quote"); 2853if (str.Length > 1 && str[str.Length - 1] == quoteChar)
System\Data\Odbc\OdbcUtils.cs (14)
390while ((_idx < _len) && char.IsWhiteSpace(_sqlstatement[_idx])) 409if (IsValidNameChar(_sqlstatement[curidx])) 411while ((curidx < _len) && IsValidNameChar(_sqlstatement[curidx])) 413_token.Append(_sqlstatement[curidx]); 419char currentchar = _sqlstatement[curidx]; 456Debug.Assert((_sqlstatement[curidx] == '['), "GetTokenFromQuote: character at starting position must be same as quotechar"); 459_token.Append(_sqlstatement[curidx]); 461if (_sqlstatement[curidx - 1] == ']') 473Debug.Assert((_sqlstatement[curidx] == _quote), "GetTokenFromQuote: character at starting position must be same as quotechar"); 478_token.Append(_sqlstatement[localidx]); // append current character to token 479if (_sqlstatement[localidx] == _quote) 483if (_sqlstatement[localidx - 1] != _escape) 487if (_sqlstatement[localidx + 1] != _quote) 534while ((tempidx < _len) && char.IsWhiteSpace(_sqlstatement[tempidx]))
System.Diagnostics.DiagnosticSource (30)
System\Diagnostics\Activity.cs (3)
1339char lastChar = parentId[parentId.Length - 1]; 1387if (parentId[trimPosition - 1] == '.' || parentId[trimPosition - 1] == '_')
System\Diagnostics\DsesFilterAndTransform.cs (4)
63while (0 < endIdx && char.IsWhiteSpace(filterAndPayloadSpecs[endIdx - 1])) 72while (startIdx < endIdx && char.IsWhiteSpace(filterAndPayloadSpecs[startIdx])) 154if (startTransformIdx < endIdx && filterAndPayloadSpec[startTransformIdx] == '-') 347if (startTransformIdx < endIdx && filterAndPayloadSpec[startTransformIdx] == '-')
System\Diagnostics\LegacyPropagator.cs (16)
100while (currentIndex < baggageString.Length && (baggageString[currentIndex] == Space || baggageString[currentIndex] == Tab)) 113while (currentIndex < baggageString.Length && baggageString[currentIndex] != Space && baggageString[currentIndex] != Tab && baggageString[currentIndex] != '=') 125if (baggageString[currentIndex] != '=') 128while (currentIndex < baggageString.Length && (baggageString[currentIndex] == Space || baggageString[currentIndex] == Tab)) 138if (baggageString[currentIndex] != '=') 147while (currentIndex < baggageString.Length && (baggageString[currentIndex] == Space || baggageString[currentIndex] == Tab)) 160while (currentIndex < baggageString.Length && baggageString[currentIndex] != Space && baggageString[currentIndex] != Tab && 161baggageString[currentIndex] != Comma && baggageString[currentIndex] != Semicolon) 177while (currentIndex < baggageString.Length && baggageString[currentIndex] != Comma)
System\Diagnostics\Metrics\MetricsEventSource.cs (1)
727&& spec.MeterName[spec.MeterName.Length - 1] == '*')
System\Diagnostics\W3CPropagator.cs (6)
175if (traceState[processed - 1] == Comma) 622if (IsInvalidTraceParentCharacter(traceParent[i])) 627isAllZeroes &= traceParent[i] == '0'; 638if (IsInvalidTraceParentCharacter(traceParent[i])) 643isAllZeroes &= traceParent[i] == '0'; 680vsb.Append(hexChars[b & 0x0F]);
System.Diagnostics.TextWriterTraceListener (1)
System\Diagnostics\XmlWriterTraceListener.cs (1)
336switch (str[i])
System.Drawing.Primitives (1)
src\libraries\Common\src\System\Drawing\ColorConverterCommon.cs (1)
41if (text.Length >= 2 && (text[0] == '\'' || text[0] == '"') && text[0] == text[text.Length - 1])
System.Formats.Tar (10)
src\libraries\Common\src\System\IO\PathInternal.cs (3)
37&& (commonChars == second.Length || IsDirectorySeparator(second[commonChars]))) 40if (commonChars == second.Length && IsDirectorySeparator(first[commonChars])) 44while (commonChars > 0 && !IsDirectorySeparator(first[commonChars - 1]))
src\libraries\Common\src\System\IO\PathInternal.Unix.cs (4)
49if (IsDirectorySeparator(path[i]) 50&& (i + 1 < path.Length && IsDirectorySeparator(path[i + 1]))) 64char current = path[i]; 68&& (i + 1 < path.Length && IsDirectorySeparator(path[i + 1])))
System\Formats\Tar\TarHeader.cs (2)
124throw new ArgumentException(SR.Format(SR.TarExtAttrDisallowedKeyChar, kvp.Key, kvp.Key[index] == '\n' ? "\\n" : kvp.Key[index]));
System\Formats\Tar\TarHelpers.cs (1)
459!IsDirectorySeparatorChar(childFullPath[parentFullPath.Length]))
System.IO.FileSystem.Watcher (7)
src\libraries\Common\src\System\IO\PathInternal.cs (3)
37&& (commonChars == second.Length || IsDirectorySeparator(second[commonChars]))) 40if (commonChars == second.Length && IsDirectorySeparator(first[commonChars])) 44while (commonChars > 0 && !IsDirectorySeparator(first[commonChars - 1]))
src\libraries\Common\src\System\IO\PathInternal.Unix.cs (4)
49if (IsDirectorySeparator(path[i]) 50&& (i + 1 < path.Length && IsDirectorySeparator(path[i + 1]))) 64char current = path[i]; 68&& (i + 1 < path.Length && IsDirectorySeparator(path[i + 1])))
System.IO.IsolatedStorage (2)
System\IO\IsolatedStorage\IsolatedStorageFile.cs (2)
548if (partialPath[i] != Path.DirectorySeparatorChar && partialPath[i] != Path.AltDirectorySeparatorChar)
System.IO.Packaging (16)
System\IO\Packaging\ContentType.cs (7)
83if (IsLinearWhiteSpaceChar(contentType[0]) || IsLinearWhiteSpaceChar(contentType[contentType.Length - 1])) 254Debug.Assert(!IsLinearWhiteSpaceChar(contentType[0]) && !IsLinearWhiteSpaceChar(contentType[contentType.Length - 1])); 264if (contentType[index - 1] == s_linearWhiteSpaceChars[1] || contentType[index + 1] == s_linearWhiteSpaceChars[1]) 417if (!IsAsciiLetterOrDigit(token[i]) && !IsAllowedCharacter(token[i])) 440parameterValue[parameterValue.Length - 1] == '"')
System\IO\Packaging\Package.cs (3)
446&& normalizedPartName[precedingPartName.Length] == PackUriHelper.ForwardSlashChar) 1000&& normalizedPartName[precedingPartName.Length] == PackUriHelper.ForwardSlashChar) || 1004&& followingPartName[normalizedPartName.Length] == PackUriHelper.ForwardSlashChar))
System\IO\Packaging\PackUriHelper.cs (1)
476if (partName[partName.Length - 1] == ForwardSlashChar)
System\IO\Packaging\ZipPackagePartPiece.cs (5)
76if (path[searchPosition - 1] == ']') 97&& char.IsDigit(path[searchPosition - 1]); 104for (digitStart = searchPosition; digitStart > 1 && char.IsDigit(path[digitStart - 1]); digitStart--) ; 116&& path[searchPosition - 1] == '[' 117&& path[searchPosition - 2] == '/';
System.IO.Ports (2)
System\IO\Ports\SerialPort.cs (2)
1069char lastValueChar = value[value.Length - 1]; 1115if (value[value.Length - i] != currentLine[currentLine.Length - i])
System.Net.Http.Json (1)
System\Net\Http\Json\JsonHelpers.cs (1)
39if (charset.Length > 2 && charset[0] == '\"' && charset[charset.Length - 1] == '\"')
System.Net.HttpListener (41)
src\libraries\Common\src\System\Net\CookieParser.cs (8)
198while ((_index < _length) && char.IsWhiteSpace(_tokenStream[_index])) 209if (_tokenStream[_index] == '"') 216char currChar = _tokenStream[_index]; 243&& (_tokenStream[_index] != ';') 244&& (ignoreEquals || (_tokenStream[_index] != '=')) 245&& (ignoreComma || (_tokenStream[_index] != ','))) 250if (_tokenStream[_index] == ',') 261switch (_tokenStream[_index])
src\libraries\Common\src\System\Net\WebHeaderEncoding.cs (1)
71*newBufferPointer++ = (byte)myString[charIndex++];
src\libraries\Common\src\System\Net\WebSockets\WebSocketValidate.cs (1)
47char invalidChar = subProtocol[indexOfInvalidChar];
System\Net\HttpListener.cs (6)
130while (j < uriPrefix.Length && uriPrefix[j] != '/' && (uriPrefix[j] != ':' || inSquareBrakets)) 132if (uriPrefix[j] == '[') 141if (inSquareBrakets && uriPrefix[j] == ']') 173if (uriPrefix[j] != ':') 180if (state.uriPrefix[state.j] == ':')
System\Net\HttpListenerRequest.cs (18)
304char chPrev = headerValue[i - 1]; 305char chNext = headerValue[i + k]; 317while (i < l && char.IsWhiteSpace(headerValue[i])) 319if (i >= l || headerValue[i] != '=') 322while (i < l && char.IsWhiteSpace(headerValue[i])) 332if (i < l && headerValue[i] == '"') 346if (headerValue[j] == ';') 385if (i < l && s[i] == ' ') 421char ch = s[pos]; 429if (s[pos + 1] == 'u' && pos < count - 5) 431int h1 = HexConverter.FromChar(s[pos + 2]); 432int h2 = HexConverter.FromChar(s[pos + 3]); 433int h3 = HexConverter.FromChar(s[pos + 4]); 434int h4 = HexConverter.FromChar(s[pos + 5]); 448int h1 = HexConverter.FromChar(s[pos + 1]); 449int h2 = HexConverter.FromChar(s[pos + 2]); 547char ch = s[i]; 588if (i == l - 1 && s[i] == '&')
System\Net\HttpListenerRequestUriBuilder.cs (2)
179current = _rawPath[index]; 189current = _rawPath[index];
System\Net\HttpListenerResponse.cs (1)
162char c = (char)(0x000000ff & (uint)value[i]);
System\Net\ServiceNameStore.cs (4)
231while (j < uriPrefix.Length && uriPrefix[j] != '/' && (uriPrefix[j] != ':' || inSquareBrackets)) 233if (uriPrefix[j] == '[') 242if (inSquareBrackets && uriPrefix[j] == ']')
System.Net.Mail (105)
System\Net\BufferBuilder.cs (1)
94char c = value[offset + i];
System\Net\Mail\Attachment.cs (1)
137if (value.Length == 0 || offset >= mediaType.Length || mediaType[offset++] != '/')
System\Net\Mail\DomainLiteralReader.cs (5)
35Debug.Assert(data[index] == MailBnfHelper.EndSquareBracket, "data did not end with a square bracket"); 67else if (data[index] == MailBnfHelper.StartSquareBracket) 74else if (!Ascii.IsValid(data[index]) || !MailBnfHelper.Dtext[data[index]]) 78throw new FormatException(SR.Format(SR.MailHeaderFieldInvalidCharacter, data[index]));
System\Net\Mail\DotAtomReader.cs (9)
47if (Ascii.IsValid(data[index]) // Any ASCII allowed 48&& ((data[index] != MailBnfHelper.Dot && !MailBnfHelper.Atext[data[index]]) 49|| (data[index] == MailBnfHelper.Dot && index > 0 && data[index - 1] == MailBnfHelper.Dot))) // Invalid char 60throw new FormatException(SR.Format(SR.MailHeaderFieldInvalidCharacter, data[index])); 68else if (index > 0 && data[index] == MailBnfHelper.Dot && data[index - 1] == MailBnfHelper.Dot) 81else if (data[index + 1] == MailBnfHelper.Dot)
System\Net\Mail\MailAddressParser.cs (19)
45Debug.Assert(index == -1 || data[index] == MailBnfHelper.Comma, 85if (data[index] == MailBnfHelper.EndAngleBracket) 98if (data[index] != MailBnfHelper.At) 123if (index >= 0 && data[index] == MailBnfHelper.StartAngleBracket) 139(index >= 0 ? data[index] : MailBnfHelper.EndAngleBracket))); 151if (index >= 0 && !(expectMultipleAddresses && data[index] == MailBnfHelper.Comma)) 223if (data[index] == MailBnfHelper.EndSquareBracket) 285if (data[index] == MailBnfHelper.Quote) 306MailBnfHelper.IsAllowedWhiteSpace(data[index]) // < local@domain > 307|| data[index] == MailBnfHelper.EndComment // <(comment)local@domain> 308|| (expectAngleBracket && data[index] == MailBnfHelper.StartAngleBracket) // <local@domain> 309|| (expectMultipleAddresses && data[index] == MailBnfHelper.Comma) // local@dom,local@dom 312|| data[index] == MailBnfHelper.Quote // "display"local@domain 318throw new FormatException(SR.Format(SR.MailHeaderFieldInvalidCharacter, data[index])); 373if (firstNonCommentIndex >= 0 && data[firstNonCommentIndex] == MailBnfHelper.Quote) 382Debug.Assert(data[index + 1] == MailBnfHelper.Quote, $"Mis-aligned index: {index}"); 396if (index >= 0 && !(expectMultipleAddresses && data[index] == MailBnfHelper.Comma)) 401throw new FormatException(SR.Format(SR.MailHeaderFieldInvalidCharacter, data[index])); 421Debug.Assert(index < 0 || data[index] == MailBnfHelper.Comma, $"Mis-aligned index: {index}");
System\Net\Mail\MailBnfHelper.cs (30)
127if (data[offset] > 127) 128throw new FormatException(SR.Format(SR.MailHeaderFieldInvalidCharacter, data[offset])); 129else if (data[offset] == '\\' && comments > 0) 131else if (data[offset] == '(') 133else if (data[offset] == ')') 135else if (data[offset] != ' ' && data[offset] != '\t' && comments == 0) 140throw new FormatException(SR.Format(SR.MailHeaderFieldInvalidCharacter, data[offset])); 172if (data[offset] == '\\') 177else if (data[offset] == '"') 183else if (data[offset] == '=' && 185data[offset + 1] == '\r' && 186data[offset + 2] == '\n' && 187(data[offset + 3] == ' ' || data[offset + 3] == '\t')) 196if (Ascii.IsValid(data[offset]) && !Qtext[data[offset]]) 197throw new FormatException(SR.Format(SR.MailHeaderFieldInvalidCharacter, data[offset])); 200else if (!Ascii.IsValid(data[offset]) || !Qtext[data[offset]]) 202throw new FormatException(SR.Format(SR.MailHeaderFieldInvalidCharacter, data[offset])); 298if (CheckForUnicode(data[offset], allowUnicode)) 303if (!s_charactersAllowedInTokens.Contains(data[offset]) || data[offset] == ' ') 308if (CheckForUnicode(data[offset], allowUnicode)) 317else if (!Qtext[data[offset]]) 366return (data[index] == MailBnfHelper.CR 368&& data[index + 1] == MailBnfHelper.LF 369&& (data[index + 2] == MailBnfHelper.Space 370|| data[index + 2] == MailBnfHelper.Tab));
System\Net\Mail\QuotedPairReader.cs (6)
39if (index <= 0 || data[index - 1] != MailBnfHelper.Backslash) 56if (!permitUnicodeEscaping && !Ascii.IsValid(data[index])) 61throw new FormatException(SR.Format(SR.MailHeaderFieldInvalidCharacter, data[index])); 85Debug.Assert(index >= 0 && data[index] == MailBnfHelper.Backslash, $"index was not a backslash: {index}"); 93} while (index >= 0 && data[index] == MailBnfHelper.Backslash); 96Debug.Assert(index < 0 || data[index] != MailBnfHelper.Backslash, $"index was a backslash: {index}");
System\Net\Mail\QuotedStringFormatReader.cs (7)
40Debug.Assert(data[index] == MailBnfHelper.Quote, $"Initial char at index {index} was not a quote."); 72else if (data[index] == MailBnfHelper.Quote) 79else if (!IsValidQtext(permitUnicode, data[index])) 83throw new FormatException(SR.Format(SR.MailHeaderFieldInvalidCharacter, data[index])); 156else if (expectCommaDelimiter && data[index] == MailBnfHelper.Comma) 161else if (!IsValidQtext(permitUnicode, data[index])) 165throw new FormatException(SR.Format(SR.MailHeaderFieldInvalidCharacter, data[index]));
System\Net\Mail\SmtpClient.cs (1)
134ch = clientDomainRaw[i];
System\Net\Mail\WhitespaceReader.cs (10)
42if (data[index] == MailBnfHelper.CR && expectCR) 47else if (data[index] == MailBnfHelper.CR || expectCR) 61else if (data[index] == MailBnfHelper.LF) 66else if (data[index] == MailBnfHelper.Space || data[index] == MailBnfHelper.Tab) 143else if (data[index] == MailBnfHelper.EndComment) 149else if (data[index] == MailBnfHelper.StartComment) 170&& (!Ascii.IsValid(data[index]) || MailBnfHelper.Ctext[data[index]])) 179throw new FormatException(SR.Format(SR.MailHeaderFieldInvalidCharacter, data[index]));
System\Net\Mime\BaseWriter.cs (2)
83else if (value[index] == MailBnfHelper.Space || value[index] == MailBnfHelper.Tab)
System\Net\Mime\ByteEncoder.cs (3)
133return char.IsSurrogate(value[i]) && i + 1 < value.Length && char.IsSurrogatePair(value[i], value[i + 1]);
System\Net\Mime\ContentDisposition.cs (4)
282if (_disposition[offset++] != ';') 284throw new FormatException(SR.Format(SR.MailHeaderFieldInvalidCharacter, _disposition[offset - 1])); 297if (_disposition[offset++] != '=') 309paramValue = _disposition[offset] == '"' ?
System\Net\Mime\ContentType.cs (5)
99if (_mediaType.Length == 0 || offset >= value.Length || value[offset++] != '/') 227if (string.IsNullOrEmpty(_mediaType) || offset >= _type.Length || _type[offset++] != '/') 240if (_type[offset++] != ';') 258if (offset >= _type.Length || _type[offset++] != '=') 268paramValue = _type[offset] == '"' ?
System\Net\Mime\QEncoder.cs (2)
61if (value[i] == '\r' && i + 1 < value.Length && value[i + 1] == '\n')
System.Net.WebHeaderCollection (4)
src\libraries\Common\src\System\Net\HttpValidationHelpers.cs (2)
55char c = (char)(0x000000ff & (uint)value[i]); 108switch (stringValue[i])
System\Net\HeaderInfoTable.cs (2)
32if (value[i] == '\"') 36else if ((value[i] == ',') && !inquote)
System.Net.WebSockets.Client (1)
src\libraries\Common\src\System\Net\WebSockets\WebSocketValidate.cs (1)
47char invalidChar = subProtocol[indexOfInvalidChar];
System.Private.CoreLib (289)
src\libraries\Common\src\Interop\Linux\procfs\Interop.ProcMountInfo.cs (1)
48if (mount.MountPoint.Length > 1 && path[mount.MountPoint.Length] != '/')
src\libraries\Common\src\System\IO\PathInternal.cs (3)
37&& (commonChars == second.Length || IsDirectorySeparator(second[commonChars]))) 40if (commonChars == second.Length && IsDirectorySeparator(first[commonChars])) 44while (commonChars > 0 && !IsDirectorySeparator(first[commonChars - 1]))
src\libraries\Common\src\System\IO\PathInternal.Unix.cs (4)
49if (IsDirectorySeparator(path[i]) 50&& (i + 1 < path.Length && IsDirectorySeparator(path[i + 1]))) 64char current = path[i]; 68&& (i + 1 < path.Length && IsDirectorySeparator(path[i + 1])))
src\libraries\Common\src\System\IO\StringParser.cs (2)
104if (_buffer[_startIndex] != '(') 293char result = _buffer[_startIndex];
src\libraries\Common\src\System\Memory\FixedBufferExtensions.cs (2)
43if (value[i] == '\0' || value[i] != span[i])
src\libraries\Common\src\System\Reflection\AssemblyNameFormatter.cs (2)
116switch (s[i]) 136vsb.Append(s[i]);
src\libraries\System.Private.CoreLib\src\System\Char.cs (21)
645return IsControl(s[index]); 659char c = s[index]; 679char c = s[index]; 700char c = s[index]; 717char c = s[index]; 759char c = s[index]; 792char c = s[index]; 834char c = s[index]; 859return IsSurrogate(s[index]); 889char c = s[index]; 906char c = s[index]; 929return IsWhiteSpace(s[index]); 952if (IsLatin1(s[index])) 954return GetLatin1UnicodeCategory(s[index]); 998return IsHighSurrogate(s[index]); 1020return IsLowSurrogate(s[index]); 1039return IsSurrogatePair(s[index], s[index + 1]); 1145int temp1 = s[index] - CharUnicodeInfo.HIGH_SURROGATE_START; 1155int temp2 = s[index + 1] - CharUnicodeInfo.LOW_SURROGATE_START; 1171return s[index];
src\libraries\System.Private.CoreLib\src\System\CharEnumerator.cs (1)
49return s[index];
src\libraries\System.Private.CoreLib\src\System\Diagnostics\DebugProvider.Unix.cs (2)
79if (message[i] <= 0x7F) 81buf[bufCount] = (byte)message[i];
src\libraries\System.Private.CoreLib\src\System\Diagnostics\StackTrace.cs (1)
261char ch = fullName[i];
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventSource.cs (12)
6096if (eventMessage[i] == '%') 6105(eventMessage[i] == '{' && eventMessage[i + 1] == '{' || eventMessage[i] == '}' && eventMessage[i + 1] == '}')) 6109stringBuilder.Append(eventMessage[i]); 6113else if (eventMessage[i] == '{') 6118while (i < eventMessage.Length && char.IsDigit(eventMessage[i])) 6120argNum = argNum * 10 + eventMessage[i] - '0'; 6123if (i < eventMessage.Length && eventMessage[i] == '}') 6132if (i < eventMessage.Length && eventMessage[i] == '!') 6144else if ((chIdx = "&<>'\"\r\n\t".IndexOf(eventMessage[i])) >= 0)
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\TraceLoggingEventSource.cs (3)
811if (value[i] != ' ') // Skip spaces between bytes. 817metaData.Add((byte)(HexDigit(value[i]) * 16 + HexDigit(value[i + 1])));
src\libraries\System.Private.CoreLib\src\System\Environment.GetFolderPathCore.Unix.cs (4)
206if (pos >= line.Length - 4 || line[pos] != '=') continue; // 4 for ="" and at least one char between quotes 211if (pos >= line.Length - 3 || line[pos] != '"') continue; // 3 for "" and at least one char between quotes 222else if (line[pos] != '/') // if not relative to home, must be absolute path 250while (pos < line.Length && char.IsWhiteSpace(line[pos])) pos++;
src\libraries\System.Private.CoreLib\src\System\Environment.OSVersion.Unix.cs (1)
40char c = text[pos];
src\libraries\System.Private.CoreLib\src\System\Environment.UnixOrBrowser.cs (1)
31if (name[lastPos] == '%')
src\libraries\System.Private.CoreLib\src\System\Globalization\CalendarData.Icu.cs (17)
187if (s[index] == '\'') 191modifiedPattern[index] = s[index]; 193} while (index < s.Length && s[index] != '\''); 198else if (s[index] == 'y') 204modifiedPattern[index] = s[index]; 208if (index >= s.Length - 1 || s[index + 1] != 'y') 214if (index + 2 < s.Length && s[index + 2] == 'y') 233modifiedPattern[index + 2] = s[index]; 270switch (input[index]) 275destination.Append(input[index++]); 278char current = input[index++]; 302int occurrences = CountOccurrences(input, input[index], ref index); 331Debug.Assert(!unsupportedDateFieldSymbols.Contains(input[index]), 332$"Encountered an unexpected date field symbol '{input[index]}' from ICU which has no known corresponding .NET equivalent."); 334destination.Append(input[index++]); 344char dayChar = input[index]; 359while (index < input.Length && input[index] == value)
src\libraries\System.Private.CoreLib\src\System\Globalization\CharUnicodeInfo.cs (2)
421codePoint = s[index]; 428int temp2 = s[index] - LOW_SURROGATE_START;
src\libraries\System.Private.CoreLib\src\System\Globalization\CultureData.cs (25)
742while (i < name.Length && name[i] != '-' && name[i] != '_') 744if (char.IsAsciiLetterUpper(name[i])) 747normalizedName[i] = (char)(((int)name[i]) + 0x20); 752normalizedName[i] = name[i]; 765if (char.IsAsciiLetterLower(name[i])) 767normalizedName[i] = (char)(((int)name[i]) - 0x20); 772normalizedName[i] = name[i]; 1427if (time[j] == '\'') 1435if (time[j] == '\\') 1447switch (time[j]) 1456(time[iLastToken + 1] != '\'') && 1457(time[j - 1] != '\'')) 1498switch (time[index]) 1505if (time[index] == ' ') 2019switch (str[i]) 2029result.Append(str[i]); 2033result?.Append(str[i]); 2073char cTimePart = format[index]; 2078} while (index < format.Length && format[index] == cTimePart); 2105if (!inQuote && timeParts.Contains(format[i])) 2109switch (format[i]) 2115switch (format[i]) 2172result[i] = char.ToString(digits[i]); 2187while ((uint)ffffPos < (uint)digits.Length && digits[ffffPos] != '\uFFFF')
src\libraries\System.Private.CoreLib\src\System\Globalization\CultureData.Icu.cs (12)
55char c = name[i]; 56if (c == '-' && i < name.Length - 1 && name[i + 1] == '-') 102buffer[bufferIndex++] = name[i]; 628char c = subject[i]; 638if (subject[i - 1] == '_' || subject[i - 1] == '-') return false; 647if (indexOfExtensions < 0 && i < subject.Length - 2 && (subject[i + 1] is 'u' or 't') && subject[i + 2] == '-') // we have -u- or -t- which is an extension 649if (subject[i + 1] == 't' || i >= subject.Length - 6 || subject[i + 3] != 'c' || subject[i + 4] != 'o' || subject[i + 5] != '-') // not -u-co- collation extension
src\libraries\System.Private.CoreLib\src\System\Globalization\CultureData.Nls.cs (6)
217if (str[i] == '\'') 223if (i + 1 < str.Length && str[i + 1] == '\'') 245else if (str[i] == '\\') 257result?.Append(str[i]); 318if (!char.IsBetween(win32Str[i], '1', '9')) 321values[j] = (int)(win32Str[i] - '0');
src\libraries\System.Private.CoreLib\src\System\Globalization\CultureInfo.cs (2)
283if ('-' == name[idx]) 321char c = cultureName[i];
src\libraries\System.Private.CoreLib\src\System\Globalization\DateTimeFormatInfo.cs (5)
935switch (longTimePattern[i]) 944if (inQuote && (quote == longTimePattern[i])) 951quote = longTimePattern[i]; 2514if (length1 == 1 && length2 == 1 && string1[offset1] == string2[offset2])
src\libraries\System.Private.CoreLib\src\System\Globalization\DateTimeFormatInfoScanner.cs (13)
130char ch = pattern[currentIndex]; 137ch = pattern[currentIndex]; 277char ch = pattern[index]; 296dateWord.Append(pattern[index]); 330while ((uint)++index < (uint)pattern.Length && pattern[index] == ch) 411char ch = pattern[i]; 424if ((uint)i < (uint)pattern.Length && pattern[i] == '\'') 630while ((uint)index < (uint)s.Length && char.IsAsciiDigit(s[index])) 645switch (s[index]) 658if (s[index] == '\'' && s[index + 1] == ' ' && 659s[index + 2] == CJKMonthSuff && s[index + 3] == '\'')
src\libraries\System.Private.CoreLib\src\System\Globalization\DateTimeParse.cs (10)
1270char ch = datePattern[i]; 1291for (; i + 1 < datePattern.Length && datePattern[i + 1] == 'y'; i++) 1302for (; i + 1 < datePattern.Length && datePattern[i + 1] == 'M'; i++) 1313for (; i + 1 < datePattern.Length && datePattern[i + 1] == 'd'; i++) 1366char ch = pattern[i]; 1387for (; i + 1 < pattern.Length && pattern[i + 1] == 'y'; i++) 1397for (; i + 1 < pattern.Length && pattern[i + 1] == 'M'; i++) 1432char ch = pattern[i]; 1452for (; i + 1 < pattern.Length && pattern[i + 1] == 'd'; i++) 1471for (; i + 1 < pattern.Length && pattern[i + 1] == 'M'; i++)
src\libraries\System.Private.CoreLib\src\System\Globalization\IcuLocaleData.cs (1)
3813char ch = name[i];
src\libraries\System.Private.CoreLib\src\System\Globalization\IdnMapping.cs (14)
81if (unicode[index + count - 1] == 0) 127if (count > 0 && ascii[index + count - 1] == (char)0) 230if (unicode[i] <= 0x1f) 236if (bCheckAscii && unicode[i] >= 0x7f) 240if (IsDot(unicode[i])) 252ValidateStd3(unicode[i - 1], true); 262ValidateStd3(unicode[i], i == iLastDot + 1); 392if (Basic(unicode[basicCount])) 394output.Append(EncodeBasic(unicode[basicCount])); 652if (ascii[copyAscii] > 0x7f) 656output.Append((char)(char.IsAsciiLetterUpper(ascii[copyAscii]) ? ascii[copyAscii] - 'A' + 'a' : ascii[copyAscii])); 691int digit = DecodeDigit(ascii[asciiIndex++]);
src\libraries\System.Private.CoreLib\src\System\Globalization\TextInfo.cs (11)
539if (isDutchCulture && i < str.Length - 1 && (str[i] == 'i' || str[i] == 'I') && (str[i + 1] == 'j' || str[i + 1] == 'J')) 570else if (str[i] == '\'') 634result.Append(input[inputIndex++]); 635result.Append(input[inputIndex]); 639result.Append(input[inputIndex]); 668switch (input[inputIndex]) 692result.Append(GlobalizationMode.Invariant ? InvariantModeCasing.ToUpper(input[inputIndex]) : ToUpper(input[inputIndex]));
src\libraries\System.Private.CoreLib\src\System\IO\DirectoryInfo.cs (1)
91&& ((trimmedNewPath.Length == trimmedCurrentPath.Length) || PathInternal.IsDirectorySeparator(newPath[trimmedCurrentPath.Length])))
src\libraries\System.Private.CoreLib\src\System\IO\Enumeration\FileSystemName.cs (4)
26char c = expression[i]; 31if (i >= 1 && i == length - 1 && expression[i - 1] == '*') 35else if (i < length - 1 && (expression[i + 1] == '?' || expression[i + 1] == '*'))
src\libraries\System.Private.CoreLib\src\System\IO\FileSystem.Unix.cs (3)
325if (PathInternal.IsDirectorySeparator(fullPath[i])) 333Debug.Assert(!PathInternal.IsDirectorySeparator(fullPath[i])); 334while (!PathInternal.IsDirectorySeparator(fullPath[i]))
src\libraries\System.Private.CoreLib\src\System\IO\FileSystemInfo.cs (1)
54char ch = FullPath[i];
src\libraries\System.Private.CoreLib\src\System\IO\Path.cs (3)
53char ch = path[i]; 917if (PathInternal.IsDirectorySeparator(relativeTo[i])) 924else if (PathInternal.IsDirectorySeparator(path[commonLength]))
src\libraries\System.Private.CoreLib\src\System\IO\Path.Unix.cs (1)
91PathInternal.IsDirectorySeparator(path[path.Length - 1]) ? path :
src\libraries\System.Private.CoreLib\src\System\IO\StringReader.cs (3)
54return s[pos]; 75return s[pos]; 196if ((uint)pos < (uint)s.Length && s[pos] == '\n')
src\libraries\System.Private.CoreLib\src\System\Net\WebUtility.cs (4)
316char ch = value[i]; 464char ch = value[pos]; 473int h1 = HexConverter.FromChar(value[pos + 1]); 474int h2 = HexConverter.FromChar(value[pos + 2]);
src\libraries\System.Private.CoreLib\src\System\Number.Formatting.cs (3)
1393*(--p) = sNegative[i]; 1826*(--p) = sNegative[i]; 2254*(--p) = sNegative[i];
src\libraries\System.Private.CoreLib\src\System\PasteArguments.cs (4)
34char c = argument[idx++]; 38while (idx < argument.Length && argument[idx] == Backslash) 49else if (argument[idx] == Quote) 85char c = s[i];
src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\SymbolType.cs (19)
66if (format[curIndex] == '&') 81if (format[curIndex] == '[') 95while (format[curIndex] != ']') 97if (format[curIndex] == '*') 103if (char.IsAsciiDigit(format[curIndex]) || format[curIndex] == '-') 106if (format[curIndex] == '-') 113while (char.IsAsciiDigit(format[curIndex])) 116iLowerBound += format[curIndex] - '0'; 128if (format[curIndex] == '.') 134if (format[curIndex] != '.') 142if (char.IsAsciiDigit(format[curIndex]) || format[curIndex] == '-') 146if (format[curIndex] == '-') 153while (char.IsAsciiDigit(format[curIndex])) 156iUpperBound += format[curIndex] - '0'; 172if (format[curIndex] == ',') 183else if (format[curIndex] != ']') 199else if (format[curIndex] == '*')
src\libraries\System.Private.CoreLib\src\System\Resources\FastResourceComparer.cs (3)
40hash = ((hash << 5) + hash) ^ key[i]; 94r = a[i++] - b; 125r = aCh - b[i++];
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\MemoryMarshal.cs (1)
402yield return s[offset + i];
src\libraries\System.Private.CoreLib\src\System\Runtime\Loader\LibraryNameVariation.Unix.cs (1)
33containsSuffix = indexOfSuffix == libName.Length || libName[indexOfSuffix] == '.';
src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\Helpers\AhoCorasickBuilder.cs (1)
77char c = value[i];
src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\Helpers\RabinKarp.cs (1)
76hash = (hash << HashShiftPerElement) + value[i];
src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\Helpers\TeddyBucketizer.cs (4)
28char c = value[offset]; 61char c = value[offset]; 97Debug.Assert(char.IsAscii(value[j])); 98prefix = (prefix << 8) | value[j];
src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\SingleStringSearchValuesThreeChars.cs (2)
59_ch2 = value[ch2Offset]; 60_ch3 = value[ch3Offset];
src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\StringSearchValues.cs (4)
360char c = value[i]; 495if (char.IsHighSurrogate(value[i])) 497if ((uint)(i + 1) >= (uint)value.Length || !char.IsLowSurrogate(value[i + 1])) 505else if (char.IsLowSurrogate(value[i]))
src\libraries\System.Private.CoreLib\src\System\Security\SecurityElement.cs (1)
363return str[index].ToString();
src\libraries\System.Private.CoreLib\src\System\String.Comparison.cs (1)
609return ((uint)lastPos < (uint)Length) && this[lastPos] == value;
src\libraries\System.Private.CoreLib\src\System\String.cs (1)
514if (!char.IsWhiteSpace(value[i])) return false;
src\libraries\System.Private.CoreLib\src\System\String.Manipulation.cs (6)
1613int stride = this[idxOfFirstNewlineChar] == '\r' && 1615this[idxOfFirstNewlineChar + 1] == '\n' ? 2 : 1; 2476if (!char.IsWhiteSpace(this[start])) 2487if (!char.IsWhiteSpace(this[end])) 2513char ch = this[start]; 2534char ch = this[end];
src\libraries\System.Private.CoreLib\src\System\Text\DecoderReplacementFallback.cs (1)
135return _strDefault[_fallbackIndex];
src\libraries\System.Private.CoreLib\src\System\Text\EncoderReplacementFallback.cs (3)
102char.IsLowSurrogate(_strDefault[_fallbackIndex + 1])) 103ThrowLastCharRecursive(char.ConvertToUtf32(charUnknown, _strDefault[_fallbackIndex + 1])); 163return _strDefault[_fallbackIndex];
src\libraries\System.Private.CoreLib\src\System\Text\Rune.cs (2)
872uint returnValue = input[index]; 893uint potentialLowSurrogate = input[index];
src\libraries\System.Private.CoreLib\src\System\Text\StringBuilder.cs (4)
1560char brace = format[pos]; 1590Debug.Assert(format[pos - 1] == '{'); 1694Debug.Assert(format[pos] == '}'); 1787return format[pos];
src\libraries\System.Private.CoreLib\src\System\Text\ValueStringBuilder.AppendFormat.cs (4)
55char brace = format[pos]; 85Debug.Assert(format[pos - 1] == '{'); 189Debug.Assert(format[pos] == '}'); 274return format[pos];
src\libraries\System.Private.CoreLib\src\System\TimeZoneInfo.FullGlobalizationData.cs (4)
76for (; i < region.Length && region[i] <= '\u007F'; i++) 78regionInAscii[i] = char.IsAsciiLetterLower(region[i]) ? (byte)((region[i] - 'a') + 'A') : (byte)region[i];
src\libraries\System.Private.CoreLib\src\System\TimeZoneInfo.StringSerializer.cs (16)
205VerifyIsEscapableCharacter(_serializedText[i]); 210switch (_serializedText[i]) 274VerifyIsEscapableCharacter(_serializedText[i]); 275token.Append(_serializedText[i]); 280switch (_serializedText[i]) 311token.Append(_serializedText[i]); 418if (_serializedText[_currentTokenStartIndex] == Sep) 424if (_serializedText[_currentTokenStartIndex] != Lhs) 446if (char.IsAsciiDigit(_serializedText[_currentTokenStartIndex]) || _serializedText[_currentTokenStartIndex] is '-' or '+') 452if (_serializedText[_currentTokenStartIndex] is '0' or '1') 462if (_serializedText[_currentTokenStartIndex] != Rhs) 508(_currentTokenStartIndex < _serializedText.Length && _serializedText[_currentTokenStartIndex] == Rhs)) 523if (_serializedText[_currentTokenStartIndex] != Lhs) 577if (_serializedText[_currentTokenStartIndex] != Rhs) 594_serializedText[_currentTokenStartIndex] == Sep)
src\libraries\System.Private.CoreLib\src\System\TimeZoneInfo.Unix.NonAndroid.cs (1)
59int c = zoneId[i];
src\libraries\System.Reflection.Metadata\src\System\Reflection\Metadata\TypeNameParserHelpers.cs (2)
118char c = name[i++]; 124else if (name[i] == EscapeCharacter) // escaped escape character ;)
src\System\Exception.CoreCLR.cs (1)
275if (char.IsWhiteSpace(helpFile[digitEnd]))
src\System\Reflection\Emit\RuntimeModuleBuilder.cs (1)
600for (int j = i - 1; j >= 0 && className[j] == '\\'; j--)
System.Private.DataContractSerialization (33)
src\libraries\Common\src\System\CodeDom\CodeTypeReference.cs (13)
145if (typeName[current--] == ']') 147while (current >= 0 && typeName[current] == ',') 153if (current >= 0 && typeName[current] == '[') 169if (current > 0 && typeName[current--] == ']') 178if (typeName[current] == '[') 183else if (typeName[current] == ']') 187else if (typeName[current] == ',' && unmatchedRightBrackets == 1) 371while (start < typeName.Length && char.IsWhiteSpace(typeName[start])) start++; 372while (end >= 0 && char.IsWhiteSpace(typeName[end])) end--; 376if (typeName[start] == '[' && typeName[end] == ']') 383if (typeName[end] != ']') 388if (typeName[index] == ',')
System\Runtime\Serialization\DataContract.cs (4)
1187char ch = localName[i]; 1886char ch = format[i]; 1892if (format[i] == '}') 1896if (format[start] == '#' && i == (start + 1))
System\Runtime\Serialization\EnumDataContract.cs (3)
339if (stringValue[i] != ' ') 347if (stringValue[i] == ' ') 353if (stringValue[i] != ' ')
System\Runtime\Serialization\Json\DataContractJsonSerializer.cs (1)
354if (XmlJsonWriter.CharacterNeedsEscaping(jsonName[i]))
System\Runtime\Serialization\Json\XmlJsonReader.cs (5)
1565if (val[i] == '\\') 1573XmlExceptionHelper.ThrowXmlException(this, new XmlException(SR.Format(SR.JsonEncounteredUnexpectedCharacter, val[i]))); 1575switch (val[i]) 1581sb.Append(val[i]); 1602new XmlException(SR.Format(SR.JsonEncounteredUnexpectedCharacter, val[i])));
System\Runtime\Serialization\Json\XmlJsonWriter.cs (1)
1061throw new ArgumentException(SR.Format(SR.JsonOnlyWhitespace, ws[pos].ToString(), "WriteWhitespace"), nameof(ws));
System\Xml\ValueHandle.cs (3)
542Debug.Assert(str[i] < 128); 544if (ch == str[i]) 547if (checkLower && char.ToLowerInvariant((char)ch) == str[i])
System\Xml\XmlBufferReader.cs (1)
879if (s2[i] != (char)b)
System\Xml\XmlConverter.cs (2)
788Debug.Assert(s[i] < 128); 789buffer[offset++] = (byte)s[i];
System.Private.Uri (74)
System\DomainNameHelper.cs (2)
64if (str[start + index] == ':') 75Debug.Assert(index == -1 || char.IsAsciiLetterUpper(str[start + index]));
System\Uri.cs (61)
292char ch = _string[_info.Offset.Path]; 597if (relativeStr[i] == '/' || relativeStr[i] == '\\' || relativeStr[i] == '?' || relativeStr[i] == '#') 601else if (relativeStr[i] == ':') 977: (IsDosPath && (_string[start] == '/' || _string[start] == '\\')) 1014if (_string[start] == '/' || _string[start] == '\\') 1422if ((pattern[index] == '%') 1425char ret = UriHelper.DecodeHexChars(pattern[index + 1], pattern[index + 2]); 1432return pattern[index++]; 1461pattern[index] == '%' && 1462char.IsAsciiHexDigit(pattern[index + 1]) && 1463char.IsAsciiHexDigit(pattern[index + 2]); 1616(IsDosPath && _string[_info.Offset.Path + SecuredPathIndex - 1] == '|')) // A rare case of c|\ 1778if (_string[i1] != str[i2]) 1782if (str[i2] == ':') 1791if (i1 < _info.Offset.Path && _string[i1] != ':') 1795if (i2 < end2 && str[i2] != ':') 1895return (uint)index < (uint)uriString.Length && uriString[index] == ':'; 2229while (UriHelper.IsLWS(_string[idx])) 2241while (idx < end && (_string[idx] == '/' || _string[idx] == '\\')) 2252while (_string[idx++] != ':') 2259if (_string[idx] == '\\' || _string[idx + 1] == '\\') 2268while (idx < end && (_string[idx] == '/' || _string[idx] == '\\')) 2312while (_string[idx] != '@') 2496host[i] != _string[_info.Offset.Host + i]) 2615if ((_info.Offset.Host + i) >= _info.Offset.End || host[i] != _string[_info.Offset.Host + i]) 2640int val = portStr[idx] - '0'; 2687else if (IsDosPath && _string[_info.Offset.Path + SecuredPathIndex - 1] == '|') 2722else if (IsDosPath && _string[_info.Offset.Path + SecuredPathIndex - 1] == '|') 3099_info.Offset.End > _info.Offset.Path && _string[_info.Offset.Path] == '/') 3189while (local > idx && UriHelper.IsLWS(str[local - 1])) --local; 3237if (schemeName[i] != str[idx + i]) 3505if (origIdx < _originalUnicodeString.Length && _originalUnicodeString[origIdx] == '?') 3571if (origIdx < _originalUnicodeString.Length && _originalUnicodeString[origIdx] == '#') 3634while ((uint)i < (uint)uriString.Length && UriHelper.IsLWS(uriString[i])) 3642(uint)i < (uint)uriString.Length && uriString[i] == '/' && 3643((uint)(i + 1) >= (uint)uriString.Length || uriString[i + 1] is not ('/' or '\\'))) 3667if (uriString[i + 1] is ':' or '|') 3670if (char.IsAsciiLetter(uriString[i])) 3672if (uriString[i + 2] is '\\' or '/') 3683err = uriString[i + 1] == ':' ? ParsingError.BadScheme : ParsingError.BadFormat; 3686else if (uriString[i] is '/' or '\\') 3689if (uriString[i + 1] is '\\' or '/') 3696while ((uint)i < (uint)uriString.Length && uriString[i] is '/' or '\\') 4929if ((path1[i] != path2[i]) 4931|| (char.ToLowerInvariant(path1[i]) 4932!= char.ToLowerInvariant(path2[i])))) 4936else if (path1[i] == '/') 4955if (path1[i] == '/')
System\UriExt.cs (11)
241char c = data[i]; 246char value = UriHelper.DecodeHexChars(data[i + 1], data[i + 2]); 510if (idx >= _info.Offset.User || _string[idx - 1] == '\\' || _string[idx] == '\\') 515while (++idx < _info.Offset.User && (_string[idx] == '/' || _string[idx] == '\\')) 535if (IsDosPath && _string[_info.Offset.Path + SecuredPathIndex - 1] == '|') 833if (relativeStr.Length > 0 && (UriHelper.IsLWS(relativeStr[0]) || UriHelper.IsLWS(relativeStr[relativeStr.Length - 1]))) 1079while (otherUri._string[portIndex] != ':' && portIndex > otherUri._info.Offset.Host) 1083if (otherUri._string[portIndex] != ':')
System.Private.Xml (243)
src\libraries\Common\src\System\CSharpHelpers.cs (1)
154char ch = value[i];
System\Xml\Cache\XPathDocumentNavigator.cs (2)
911buf[idx++] = UniqueIdTbl[loc & 0x1f]; 921buf[idx++] = UniqueIdTbl[loc & 0x1f];
System\Xml\Cache\XPathNodeInfoAtom.cs (1)
141unchecked { _localNameHash += (_localNameHash << 7) ^ _localName[i]; }
System\Xml\Core\CharEntityEncoderFallback.cs (1)
130return _charEntity[_charEntityIndex++];
System\Xml\Core\XmlCharCheckingWriter.cs (6)
378if ((ch = str[i]) >= 0x20) 393if (i + 1 < str.Length && str[i + 1] == '\n') 523if (text[i] != invChar2) 527if (i > 0 && text[i - 1] == invChar1) 540return (i == 0 || text[i - 1] != invChar1) ? text : (text + ' '); 545if (i > 0 && text[i - 1] == invChar1)
System\Xml\Core\XmlEncodedRawTextWriter.cs (6)
1860if (!XmlCharType.IsTextChar(chars[i])) 1862switch (chars[i]) 1874if (XmlCharType.IsHighSurrogate(chars[i])) 1878if (XmlCharType.IsLowSurrogate(chars[i + 1])) 1887else if (XmlCharType.IsLowSurrogate(chars[i])) 1889error = SR.Format(SR.Xml_InvalidSurrogateHighChar, ((uint)chars[i]).ToString("X", CultureInfo.InvariantCulture));
System\Xml\Core\XmlTextEncoder.cs (2)
397while (i < len && (XmlCharType.IsCharData((ch = text[i])) || ch < 0x20)) 409char lowChar = text[i + 1];
System\Xml\Core\XmlTextReaderImpl.cs (3)
9623while (value[startPos] == 0x20) 9635if (value[i] == 0x20) 9638while (j < len && value[j] == 0x20)
System\Xml\Core\XmlTextWriter.cs (1)
1710if (name[position] == ':')
System\Xml\Core\XmlUtf8RawTextWriter.cs (6)
1722if (!XmlCharType.IsTextChar(chars[i])) 1724switch (chars[i]) 1736if (XmlCharType.IsHighSurrogate(chars[i])) 1740if (XmlCharType.IsLowSurrogate(chars[i + 1])) 1749else if (XmlCharType.IsLowSurrogate(chars[i])) 1751error = SR.Format(SR.Xml_InvalidSurrogateHighChar, ((uint)chars[i]).ToString("X", CultureInfo.InvariantCulture));
System\Xml\Core\XmlWellFormedWriter.cs (1)
2049if (XmlCharType.IsNCNameSingleChar(ncname[i]))
System\Xml\Schema\DtdParser.cs (3)
3548while (value[startPos] == 0x20) 3560if (value[i] == 0x20) 3563while (j < len && value[j] == 0x20)
System\Xml\Schema\FacetChecker.cs (3)
707if (pattern[position] == '\\') 709if (pattern[position + 1] == '\\') 715char ch = pattern[position + 1];
System\Xml\Schema\Inference\Infer.cs (69)
1753switch (s[i]) 1785switch (s[i]) 1791if (char.IsAsciiDigit(s[i])) 1798switch (s[i]) 1804if (char.IsAsciiDigit(s[i])) 1811switch (s[i]) 1817if (char.IsAsciiDigit(s[i])) 1824if (char.IsAsciiDigit(s[i])) 1830if (char.IsAsciiDigit(s[i])) //".9999e+9 1837switch (s[i]) 1846if (char.IsAsciiDigit(s[i])) //-9 1853switch (s[i]) 1860if (char.IsAsciiDigit(s[i])) //"+9 1867switch (s[i]) 1872if (char.IsAsciiDigit(s[i])) //"P9" 1878switch (s[i]) 1887if (char.IsAsciiDigit(s[i])) 1899switch (s[i]) 1904if (char.IsAsciiDigit(s[i])) 1911switch (s[i]) 1918if (char.IsAsciiDigit(s[i])) 1930switch (s[i]) 1935if (char.IsAsciiDigit(s[i])) 1942switch (s[i]) 1947if (char.IsAsciiDigit(s[i])) 1959switch (s[i]) 1968if (char.IsAsciiDigit(s[i])) 1974switch (s[i]) 1985if (char.IsAsciiDigit(s[i])) 1997if (char.IsAsciiDigit(s[i])) 2003switch (s[i]) 2012if (char.IsAsciiDigit(s[i])) 2024if (char.IsAsciiDigit(s[i])) 2030switch (s[i]) 2037if (char.IsAsciiDigit(s[i])) 2049if (char.IsAsciiDigit(s[i])) 2055switch (s[i]) 2060if (char.IsAsciiDigit(s[i])) 2100switch (s[i]) 2109if (char.IsAsciiDigit(s[i])) 2125switch (s[i]) 2137if (char.IsAsciiDigit(s[i])) 2154switch (s[i]) 2163if (char.IsAsciiDigit(s[i])) 2180switch (s[i]) 2192if (char.IsAsciiDigit(s[i])) 2199if (!char.IsAsciiDigit(s[i])) 2202if (!char.IsAsciiDigit(s[i])) 2210switch (s[i]) 2226if (!char.IsAsciiDigit(s[i])) 2229if (!char.IsAsciiDigit(s[i])) 2232switch (s[i]) 2267if (!char.IsAsciiDigit(s[i])) 2270if (!char.IsAsciiDigit(s[i])) 2273if (s[i] != ':') 2277if (!char.IsAsciiDigit(s[i])) 2280if (!char.IsAsciiDigit(s[i])) 2298if (!char.IsAsciiDigit(s[i])) 2301if (!char.IsAsciiDigit(s[i])) 2304if (s[i] != ':') 2308if (!char.IsAsciiDigit(s[i])) 2311if (!char.IsAsciiDigit(s[i])) 2314if (s[i] != ':') 2317if (!char.IsAsciiDigit(s[i])) 2320if (!char.IsAsciiDigit(s[i])) 2323switch (s[i]) 2338if (!char.IsAsciiDigit(s[i])) 2342switch (s[i]) 2351if (char.IsAsciiDigit(s[i]))
System\Xml\Schema\XsdDateTime.cs (11)
722while (start < _length && char.IsWhiteSpace(text[start])) 937int d = _text[start] - '0'; 991char ch = _text[start]; 1018while (start < _length && char.IsWhiteSpace(_text[start])) 1030int d4 = _text[start] - '0'; 1031int d3 = _text[start + 1] - '0'; 1032int d2 = _text[start + 2] - '0'; 1033int d1 = _text[start + 3] - '0'; 1051int d2 = _text[start] - '0'; 1052int d1 = _text[start + 1] - '0'; 1066return start < _length && _text[start] == ch;
System\Xml\Schema\XsdDuration.cs (14)
468if (s[pos] == '-') 480if (s[pos++] != 'P') goto InvalidFormat; 487if (s[pos] == 'Y') 501if (s[pos] == 'M') 515if (s[pos] == 'D') 529if (s[pos] == 'T') 539if (s[pos] == 'H') 553if (s[pos] == 'M') 567if (s[pos] == '.') 592if (s[pos] != 'S') goto InvalidFormat; 595else if (s[pos] == 'S') 649while (offset < offsetEnd && char.IsAsciiDigit(s[offset])) 651digit = s[offset] - '0'; 663while (offset < offsetEnd && char.IsAsciiDigit(s[offset]))
System\Xml\Serialization\CodeIdentifier.cs (2)
83char c = identifier[i]; 291sb.Append(originalIdentifier[separator]);
System\Xml\Serialization\XmlSerializationReader.cs (6)
983if (value[pos] != ']') 990while (pos != -1 && value[pos] != '[') 992if (value[pos] == ',') 1016while (pos != -1 && value[pos] == ']') 1021if (value[pos] == ',') 1023else if (value[pos] != '[')
System\Xml\Serialization\XmlSerializationWriterILGen.cs (2)
2590if (value[i] is < (char)32 or '\"') 2610char ch = value[i];
System\Xml\ValidateNames.cs (16)
44if (XmlCharType.IsNCNameSingleChar(s[i])) 75if (XmlCharType.IsNameSingleChar(s[i]) || s[i] == ':') 113if (XmlCharType.IsStartNCNameSingleChar(s[i]) || s[i] == ':') 125if (XmlCharType.IsNCNameSingleChar(s[i]) || s[i] == ':') 163if (XmlCharType.IsStartNCNameSingleChar(s[i])) 175if (XmlCharType.IsNCNameSingleChar(s[i])) 246if ((uint)offset < (uint)s.Length && s[offset] == ':') 323if ((uint)len < (uint)s.Length && s[len] == ':') 328if ((uint)offset < (uint)s.Length && s[offset] == '*') 378if (XmlCharType.IsNCNameSingleChar(s[offsetBadChar]) && !XmlCharType.IsStartNCNameSingleChar(s[offsetBadChar])) 398if (XmlCharType.IsNCNameSingleChar(s[offsetBadChar]) && !XmlCharType.IsStartNCNameSingleChar(s[offsetBadChar]))
System\Xml\XmlCharType.cs (1)
85return (PublicIdBitmap[ch >> 4] & (1 << (ch & 0xF))) != 0;
System\Xml\XmlComplianceUtil.cs (8)
25while (XmlCharType.IsWhiteSpace(value[startPos])) 37if (!XmlCharType.IsWhiteSpace(value[i])) 44while (j < len && XmlCharType.IsWhiteSpace(value[j])) 60if (j > i + 1 || value[i] != 0x20) 111char ch = value[i]; 125if (ch == 0xD && (i + 1 < len && value[i + 1] == 0xA)) 161char ch = value[i]; 178if (value[i] != '-')
System\Xml\XmlConvert.cs (26)
111if (name[position + 6] != '_') 114FromHex(name[position + 2]) * 0x10000000 + 115FromHex(name[position + 3]) * 0x1000000 + 116FromHex(name[position + 4]) * 0x100000 + 117FromHex(name[position + 5]) * 0x10000 + 119FromHex(name[position + 6]) * 0x1000 + 120FromHex(name[position + 7]) * 0x100 + 121FromHex(name[position + 8]) * 0x10 + 122FromHex(name[position + 9]); 147FromHex(name[position + 2]) * 0x1000 + 148FromHex(name[position + 3]) * 0x100 + 149FromHex(name[position + 4]) * 0x10 + 150FromHex(name[position + 5]))); 235if ((local && !XmlCharType.IsNCNameCharXml4e(name[position])) || 236(!local && !XmlCharType.IsNameCharXml4e(name[position])) || 249if ((length > position + 1) && XmlCharType.IsHighSurrogate(name[position]) && XmlCharType.IsLowSurrogate(name[position + 1])) 251int x = name[position]; 252int y = name[position + 1]; 260bufBld.Append($"{(int)name[position]:X4}"); 1405while (i < len && XmlCharType.IsCharData(data[i])) 1414char ch = data[i]; 1421ch = data[i + 1]; 1429throw CreateInvalidSurrogatePairException(data[i + 1], data[i], invSurrogateExceptionType, 0, i + 1); 1485char ch = value[i];
System\Xml\XmlException.cs (2)
222return BuildCharExceptionArgs(data[invCharIndex], invCharIndex + 1 < data.Length ? data[invCharIndex + 1] : '\0');
System\Xml\XPath\Internal\BooleanFunctions.cs (1)
83(lang.Length == str.Length || lang[str.Length] == '-')
System\Xml\XPath\Internal\StringFunctions.cs (1)
272chars[modifyPos] = mapTo[index];
System\Xml\XPath\Internal\XPathScanner.cs (2)
49_currentChar = expr[index]; 299Debug.Assert(0 <= start && _xpathExpr[start] == '.');
System\Xml\Xsl\Runtime\DecimalFormatter.cs (2)
68char ch = formatPicture[i]; 257char ch = result[i];
System\Xml\Xsl\Runtime\XslNumber.cs (4)
56char ch = formatString[startIdx]; 82if (formatString[idx] == ++ch) 143bool isAlphaNumeric = CharUtil.IsAlphaNumeric(formatString[idxStart]); 154if (idx == formatString.Length || isAlphaNumeric != CharUtil.IsAlphaNumeric(formatString[idx]))
System\Xml\Xsl\Runtime\XsltFunctions.cs (7)
108if (XmlCharType.IsWhiteSpace(value[idx])) 115else if (value[idx] != ' ' || idxSpace == idx) 175int index = mapString.IndexOf(arg[i]); 179sb.Append(arg[i]); 184sb.Append(transString[index]); 202return (lang.Length == value.Length || lang[value.Length] == '-'); 394switch (options[idx])
System\Xml\Xsl\XPath\XPathScanner.cs (1)
104_curChar = _xpathExpr[_curIndex];
System\Xml\Xsl\XslException.cs (1)
208if (message.Length > 0 && !XmlCharType.IsWhiteSpace(message[message.Length - 1]))
System\Xml\Xsl\Xslt\QilGenerator.cs (3)
989char ch = source[i]; 993if (i + 1 < source.Length && source[i + 1] == ch) 1019Debug.Assert(i == source.Length || source[i] == '{');
System\Xml\Xsl\Xslt\XslAstAnalyzer.cs (3)
922if (pos < source.Length && source[pos] == '{') 1281if (xpath[t] == '/' || xpath[t - 1] == '/')
System\Xml\Xsl\XsltOld\Compiler.cs (5)
811char ch = avt[i]; 814if (i + 1 < avtLength && avt[i + 1] == '{') 825if (i + 1 < avtLength && avt[i + 1] == '}') 847Debug.Assert(avt[start] == '{', "We calling getXPathLex() only after we really meet {"); 852char ch = avt[i];
System\Xml\Xsl\XsltOld\ContainerAction.cs (2)
475if (0 <= idx && name[idx] == ':' && name[idx + 1] == '*')
System\Xml\Xsl\XsltOld\NumberAction.cs (6)
585char wch = wsToken[startLen]; 603if (wsToken[startLen] != (char)(wch + 1)) 614switch ((int)wsToken[startLen]) 645if (tokLen > 1 && wsToken[startLen + 1] == 0x5b50) 689bool lastAlphaNumeric = CharUtil.IsAlphaNumeric(formatString[length]); 702bool currentchar = length < formatString.Length ? CharUtil.IsAlphaNumeric(formatString[length]) : !lastAlphaNumeric;
System\Xml\Xsl\XsltOld\PrefixQName.cs (1)
51if (qname[position] == ':')
System\Xml\Xsl\XsltOld\ProcessingInstructionAction.cs (2)
125while (position < nameLength && XmlCharType.IsWhiteSpace(name[position])) 142while (position < nameLength && XmlCharType.IsWhiteSpace(name[position]))
System\Xml\Xsl\XsltOld\RecordBuilder.cs (2)
624switch (comment[index]) 677switch (pi[index])
System\Xml\Xsl\XsltOld\SequentialOutput.cs (7)
548char ch = value[i]; 553if (i != length && value[i] == '{') 581char ch = value[i]; 586if (i != length && value[i] == '{') 646Write(value[pos]); 650char badChar = value[pos]; 673Write(value[pos]);
System.Reflection.Emit (19)
src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\SymbolType.cs (19)
66if (format[curIndex] == '&') 81if (format[curIndex] == '[') 95while (format[curIndex] != ']') 97if (format[curIndex] == '*') 103if (char.IsAsciiDigit(format[curIndex]) || format[curIndex] == '-') 106if (format[curIndex] == '-') 113while (char.IsAsciiDigit(format[curIndex])) 116iLowerBound += format[curIndex] - '0'; 128if (format[curIndex] == '.') 134if (format[curIndex] != '.') 142if (char.IsAsciiDigit(format[curIndex]) || format[curIndex] == '-') 146if (format[curIndex] == '-') 153while (char.IsAsciiDigit(format[curIndex])) 156iUpperBound += format[curIndex] - '0'; 172if (format[curIndex] == ',') 183else if (format[curIndex] != ']') 199else if (format[curIndex] == '*')
System.Reflection.Metadata (20)
src\libraries\Common\src\System\Reflection\AssemblyNameFormatter.cs (2)
116switch (s[i]) 136vsb.Append(s[i]);
System\Reflection\Internal\Utilities\MemoryBlock.cs (8)
415char currentChar = text[currentIndex]; 460Debug.Assert(asciiPrefix[i] > 0 && asciiPrefix[i] <= 0x7f); 462if (asciiPrefix[i] != *p) 484Debug.Assert(asciiString[i] > 0 && asciiString[i] <= 0x7f); 492if (*p != asciiString[i]) 496return *p - asciiString[i];
System\Reflection\Internal\Utilities\PathUtilities.cs (2)
35char ch = path[i]; 62char c = root[root.Length - 1];
System\Reflection\Metadata\Ecma335\MetadataBuilder.Heaps.cs (4)
591if (x[i] < y[j]) 596if (x[i] > y[j])
System\Reflection\Metadata\Internal\BlobHeap.cs (1)
233if (otherIndex == other.Length || !StringUtils.IsEqualAscii(other[otherIndex], separator, ignoreCaseMask))
System\Reflection\Metadata\TypeNameParserHelpers.cs (2)
118char c = name[i++]; 124else if (name[i] == EscapeCharacter) // escaped escape character ;)
System\Reflection\PortableExecutable\PEBuilder.cs (1)
364builder.WriteByte((byte)serializedSection.Name[j]);
System.Reflection.MetadataLoadContext (2)
System\Reflection\TypeLoading\General\Helpers.cs (2)
146if (identifier[i] == '\\') 152sbUnescapedName.Append(identifier[i]);
System.Resources.Extensions (6)
src\libraries\Common\src\System\Resources\ResourceWriter.cs (1)
365bw.Write("PAD"[i % 3]);
src\libraries\System.Private.CoreLib\src\System\Resources\FastResourceComparer.cs (3)
40hash = ((hash << 5) + hash) ^ key[i]; 94r = a[i++] - b; 125r = aCh - b[i++];
System\Resources\Extensions\DeserializingResourceReader.cs (2)
92if (typeName[i] == '[') 96else if (typeName[i] == ']')
System.Resources.Writer (2)
src\libraries\Common\src\System\Resources\ResourceWriter.cs (1)
365bw.Write("PAD"[i % 3]);
System\Resources\__FastResourceComparer.cs (1)
32hash = unchecked((hash << 5) + hash) ^ key[i];
System.Runtime.Numerics (2)
System\Number.BigInteger.cs (2)
602chars[charsPos++] = hexValues[b >> 4]; 603chars[charsPos++] = hexValues[b & 0xF];
System.Runtime.Serialization.Schema (3)
System\Runtime\Serialization\Schema\CodeExporter.cs (2)
1419char c = identifier[i]; 1560char c = fragment[i];
System\Runtime\Serialization\Schema\SchemaImportHelper.cs (1)
106char ch = localName[i];
System.Security.Cryptography.Pkcs (2)
Internal\Cryptography\PkcsHelpers.cs (2)
291char c = normalizedString[i * 2]; 293c = normalizedString[i * 2 + 1];
System.Security.Cryptography.Xml (5)
System\Security\Cryptography\Xml\Utils.cs (5)
147if (char.IsWhiteSpace(inputBuffer[inputOffset + i])) iCount++; 151if (!char.IsWhiteSpace(inputBuffer[inputOffset + i])) 153rgbOut[iCount++] = inputBuffer[inputOffset + i]; 731hex[index] = (byte)((HexConverter.FromChar(hexString[i]) << 4) | HexConverter.FromChar(hexString[i + 1]));
System.ServiceModel.Syndication (1)
System\ServiceModel\Syndication\DateTimeHelper.cs (1)
56while (dateTimeString.Length > i && char.IsDigit(dateTimeString[i]))
System.Text.Encoding.CodePages (4)
System\Text\EncodingTable.cs (4)
162while (i < count && s1[i] == s2[index + i]) 166return (int)(s1[i] - s2[index + i]);
System.Text.Encodings.Web (1)
System\Text\Encodings\Web\TextEncoder.cs (1)
588destination[i] = source[i];
System.Text.Json (1)
System\Text\Json\Serialization\Converters\Value\EnumConverter.cs (1)
568if (string.IsNullOrEmpty(name) || char.IsWhiteSpace(name[0]) || char.IsWhiteSpace(name[name.Length - 1]) ||
System.Text.RegularExpressions (158)
System\Text\RegularExpressions\RegexCharClass.cs (66)
454short ch = (short)category[i]; 602return set[SetStartIndex]; 611charClass[CategoryLengthIndex] == 0 && 612charClass[SetLengthIndex] == 0 && 624set[CategoryLengthIndex] == 0 && 625set[SetLengthIndex] == 2 && 628(set[SetStartIndex] == LastChar || set[SetStartIndex] + 1 == set[SetStartIndex + 1]); 631set[CategoryLengthIndex] == 0 && 632set[SetLengthIndex] == 2 && 635(set[SetStartIndex] == LastChar || set[SetStartIndex] + 1 == set[SetStartIndex + 1]); 653int categoryLength = set[CategoryLengthIndex]; 654if (categoryLength == 0 || set[SetLengthIndex] != 0 || IsSubtraction(set)) 660int categoryEnd = SetStartIndex + set[CategoryLengthIndex]; 664short c = (short)set[pos]; 763if (set[CategoryLengthIndex] == 0 && // must not have any categories 764set.Length == SetStartIndex + set[SetLengthIndex]) // and no subtraction 766switch ((int)set[SetLengthIndex]) 769lowInclusive = set[SetStartIndex]; 774lowInclusive = set[SetStartIndex]; 775highInclusive = (char)(set[SetStartIndex + 1] - 1); 794if (set[CategoryLengthIndex] == 0 && // must not have any categories 795set.Length == SetStartIndex + set[SetLengthIndex]) // and no subtraction 797int setLength = set[SetLengthIndex]; 800range0 = (set[SetStartIndex], (char)(set[SetStartIndex + 1] - 1)); 801range1 = (set[SetStartIndex + 2], setLength == 3 ? LastChar : (char)(set[SetStartIndex + 3] - 1)); 845int setLength = set[SetLengthIndex]; 849int curSetEnd = set[i + 1]; 850for (int c = set[i]; c < curSetEnd; c++) 948for (int i = SetStartIndex; i < SetStartIndex + set2[SetLengthIndex]; i += 2) 950int curSetEnd = set2[i + 1]; 951for (int c = set2[i]; c < curSetEnd; c++) 1088set[SetLengthIndex] > 0 && 1089set[SetLengthIndex] % 2 == 0 && 1090set[CategoryLengthIndex] == 0; 1140char firstValueInclusive = set[SetStartIndex]; 1141char lastValueExclusive = set[SetStartIndex + set[SetLengthIndex] - 1]; 1155ContainsNoAscii = firstValueInclusive == 0 && set[SetStartIndex + 1] >= 128, 1168AllAsciiContained = firstValueInclusive == 0 && set[SetStartIndex + 1] >= 128 && !hasSubtraction, 1178charClass[CategoryLengthIndex] + 1179charClass[SetLengthIndex]; 1181internal static bool IsNegated(string set) => set[FlagsIndex] == 1; 1183internal static bool IsNegated(string set, int setOffset) => set[FlagsIndex + setOffset] == 1; 1327int setLength = set[start + SetLengthIndex]; 1328int categoryLength = set[start + CategoryLengthIndex]; 1361if (ch < set[mid]) 1485int setLength = charClass[start + SetLengthIndex]; 1486int categoryLength = charClass[start + CategoryLengthIndex]; 1889int setLength = set[SetLengthIndex]; 1890int categoryLength = set[CategoryLengthIndex]; 1900set[SetStartIndex] + 1 == set[SetStartIndex + 1]) 1902return DescribeChar(set[SetStartIndex]); 1912int rangesEnd = SetStartIndex + set[SetLengthIndex]; 1915ch1 = set[index]; 1918ch2 = (char)(set[index + 1] - 1); 1948set[index] == 0) 1967while (index < SetStartIndex + set[SetLengthIndex] + set[CategoryLengthIndex]) 1969ch1 = set[index];
System\Text\RegularExpressions\RegexCompiler.cs (1)
3251Ldc(str[i]);
System\Text\RegularExpressions\RegexNode.cs (4)
1285while (c < minLength && startingSpan[c] == startingNode.Str[c]) c++; 1344node.Ch = node.Str[node.Str.Length - 1]; 1717while (matchingCharsInMulti < nextNode.Str.Length && currentNode.Ch == nextNode.Str[matchingCharsInMulti]) 1744nextNode.Ch = nextNode.Str[nextNode.Str.Length - 1];
System\Text\RegularExpressions\RegexParser.cs (81)
243while (i < input.Length && input[i] != '\\') 292while (_pos < _pattern.Length && (!IsSpecialOrSpace(ch = _pattern[_pos]) || (ch == '{' && !IsTrueQuantifier()))) 297while (_pos < _pattern.Length && (!IsSpecial(ch = _pattern[_pos]) || (ch == '{' && !IsTrueQuantifier()))) 309else if (IsSpecial(ch = _pattern[_pos])) 332_unit = RegexNode.CreateOneWithCaseConversion(_pattern[endpos - 1], _options, _culture, ref _caseBehavior); 434ch = _pattern[_pos++]; 461if (_pos < _pattern.Length && _pattern[_pos] == ',') 464max = _pos == _pattern.Length || _pattern[_pos] == '}' ? int.MaxValue : ScanDecimal(); 468if (startpos == _pos || _pos == _pattern.Length || _pattern[_pos++] != '}') 486if (_pos < _pattern.Length && _pattern[_pos] == '?') 557if (_pos < _pattern.Length && _pattern[_pos] == '^') 564if ((_options & RegexOptions.ECMAScript) != 0 && _pattern[_pos] == ']') 573ch = _pattern[_pos++]; 584switch (ch = _pattern[_pos++]) 682if (_pos < _pattern.Length && _pattern[_pos] != ']') 698else if (_pos + 1 < _pattern.Length && _pattern[_pos] == '-' && _pattern[_pos + 1] != ']') 705else if (_pos < _pattern.Length && ch == '-' && !translatedChar && _pattern[_pos] == '[' && !firstChar) 715if (_pos < _pattern.Length && _pattern[_pos] != ']') 754if (_pos == _pattern.Length || _pattern[_pos] != '?' || (_pos + 1 < _pattern.Length && _pattern[_pos + 1] == ')')) 778char ch = _pattern[_pos++]; 813switch (ch = _pattern[_pos++]) 855if (_pos < _pattern.Length && !(_pattern[_pos] == close || _pattern[_pos] == '-')) 875if (_pos < _pattern.Length && !(_pattern[_pos] == close || _pattern[_pos] == '-')) 892if ((capnum != -1 || proceed) && _pos + 1 < _pattern.Length && _pattern[_pos] == '-') 895ch = _pattern[_pos]; 907if (_pos < _pattern.Length && _pattern[_pos] != close) 921if (_pos < _pattern.Length && _pattern[_pos] != close) 935if ((capnum != -1 || uncapnum != -1) && _pos < _pattern.Length && _pattern[_pos++] == close) 949ch = _pattern[_pos]; 955if (_pos < _pattern.Length && _pattern[_pos++] == ')') 971if (_capnames?[capname] is int tmpCapnum && _pos < _pattern.Length && _pattern[_pos++] == ')') 982if (_pos + 2 < _pattern.Length && _pattern[_pos + 1] == '?') 985if (_pattern[_pos + 2] == '#') 991if (_pattern[_pos + 2] == '\'' || (_pos + 3 < _pattern.Length && _pattern[_pos + 2] == '<' && _pattern[_pos + 3] != '!' && _pattern[_pos + 3] != '=')) 1014if ((ch = _pattern[_pos++]) == ')') 1043while (_pos < _pattern.Length && IsSpace(_pattern[_pos])) 1049if ((_options & RegexOptions.IgnorePatternWhitespace) != 0 && _pos < _pattern.Length && _pattern[_pos] == '#') 1057else if (_pos + 2 < _pattern.Length && _pattern[_pos + 2] == '#' && _pattern[_pos + 1] == '?' && _pattern[_pos] == '(') 1081switch (ch = _pattern[_pos]) 1158char ch = _pattern[_pos]; 1167ch = _pattern[_pos++]; 1180ch = _pattern[_pos]; 1190ch = _pattern[_pos]; 1199if (_pos < _pattern.Length && _pattern[_pos++] == close) 1225if (_pos == _pattern.Length || (ch = _pattern[_pos]) < '0' || ch > '9') 1265if (_pos < _pattern.Length && _pattern[_pos++] == close) 1292char ch = _pattern[_pos]; 1303ch = _pattern[_pos]; 1325while (_pos < _pattern.Length && (ch = _pattern[_pos]) >= '0' && ch <= '9') 1351if (!angled || _pos < _pattern.Length && _pattern[_pos++] == '}') 1363if (_pos < _pattern.Length && _pattern[_pos++] == '}') 1422if (!RegexCharClass.IsBoundaryWordChar(_pattern[_pos++])) 1439for (i = 0; c > 0 && (uint)(d = _pattern[_pos] - '0') <= 7; c -= 1) 1462while (_pos < _pattern.Length && (uint)(d = (char)(_pattern[_pos] - '0')) <= 9) 1486char ch = _pattern[_pos++]; 1513char ch = _pattern[_pos++]; 1535char ch = _pattern[_pos]; 1576char ch = _pattern[_pos++]; 1625char ch = _pattern[_pos++]; 1634ch = _pattern[_pos++]; 1644if (_pos == _pattern.Length || _pattern[_pos++] != '}') 1677char ch = _pattern[_pos++]; 1707if (_pos + 1 < _pattern.Length && _pattern[_pos + 1] == '#' && _pattern[_pos] == '?') 1716if (_pos < _pattern.Length && _pattern[_pos] == '?') 1721if (_pos + 1 < _pattern.Length && (_pattern[_pos] == '<' || _pattern[_pos] == '\'')) 1726ch = _pattern[_pos]; 1750if (_pattern[_pos] == ')') 1756else if (_pattern[_pos] == '(') 1979char ch = _pattern[startpos]; 2018_concatenation!.AddChild(RegexNode.CreateOneWithCaseConversion(_pattern[pos], isReplacement ? _options & ~RegexOptions.IgnoreCase : _options, _culture, ref _caseBehavior));
System\Text\RegularExpressions\RegexPrefixAnalyzer.cs (1)
627string setString = RegexCharClass.OneToStringClass(s[i]);
System\Text\RegularExpressions\Symbolic\RegexNodeConverter.cs (5)
381int setLength = set[RegexCharClass.SetLengthIndex]; 382int catLength = set[RegexCharClass.CategoryLengthIndex]; 394short categoryCode = (short)set[i++]; 411categoryCode = (short)set[i++]; 430categoryCode = (short)set[i++];
System.Text.RegularExpressions.Generator (152)
src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexCharClass.cs (66)
454short ch = (short)category[i]; 602return set[SetStartIndex]; 611charClass[CategoryLengthIndex] == 0 && 612charClass[SetLengthIndex] == 0 && 624set[CategoryLengthIndex] == 0 && 625set[SetLengthIndex] == 2 && 628(set[SetStartIndex] == LastChar || set[SetStartIndex] + 1 == set[SetStartIndex + 1]); 631set[CategoryLengthIndex] == 0 && 632set[SetLengthIndex] == 2 && 635(set[SetStartIndex] == LastChar || set[SetStartIndex] + 1 == set[SetStartIndex + 1]); 653int categoryLength = set[CategoryLengthIndex]; 654if (categoryLength == 0 || set[SetLengthIndex] != 0 || IsSubtraction(set)) 660int categoryEnd = SetStartIndex + set[CategoryLengthIndex]; 664short c = (short)set[pos]; 763if (set[CategoryLengthIndex] == 0 && // must not have any categories 764set.Length == SetStartIndex + set[SetLengthIndex]) // and no subtraction 766switch ((int)set[SetLengthIndex]) 769lowInclusive = set[SetStartIndex]; 774lowInclusive = set[SetStartIndex]; 775highInclusive = (char)(set[SetStartIndex + 1] - 1); 794if (set[CategoryLengthIndex] == 0 && // must not have any categories 795set.Length == SetStartIndex + set[SetLengthIndex]) // and no subtraction 797int setLength = set[SetLengthIndex]; 800range0 = (set[SetStartIndex], (char)(set[SetStartIndex + 1] - 1)); 801range1 = (set[SetStartIndex + 2], setLength == 3 ? LastChar : (char)(set[SetStartIndex + 3] - 1)); 845int setLength = set[SetLengthIndex]; 849int curSetEnd = set[i + 1]; 850for (int c = set[i]; c < curSetEnd; c++) 948for (int i = SetStartIndex; i < SetStartIndex + set2[SetLengthIndex]; i += 2) 950int curSetEnd = set2[i + 1]; 951for (int c = set2[i]; c < curSetEnd; c++) 1088set[SetLengthIndex] > 0 && 1089set[SetLengthIndex] % 2 == 0 && 1090set[CategoryLengthIndex] == 0; 1140char firstValueInclusive = set[SetStartIndex]; 1141char lastValueExclusive = set[SetStartIndex + set[SetLengthIndex] - 1]; 1155ContainsNoAscii = firstValueInclusive == 0 && set[SetStartIndex + 1] >= 128, 1168AllAsciiContained = firstValueInclusive == 0 && set[SetStartIndex + 1] >= 128 && !hasSubtraction, 1178charClass[CategoryLengthIndex] + 1179charClass[SetLengthIndex]; 1181internal static bool IsNegated(string set) => set[FlagsIndex] == 1; 1183internal static bool IsNegated(string set, int setOffset) => set[FlagsIndex + setOffset] == 1; 1327int setLength = set[start + SetLengthIndex]; 1328int categoryLength = set[start + CategoryLengthIndex]; 1361if (ch < set[mid]) 1485int setLength = charClass[start + SetLengthIndex]; 1486int categoryLength = charClass[start + CategoryLengthIndex]; 1889int setLength = set[SetLengthIndex]; 1890int categoryLength = set[CategoryLengthIndex]; 1900set[SetStartIndex] + 1 == set[SetStartIndex + 1]) 1902return DescribeChar(set[SetStartIndex]); 1912int rangesEnd = SetStartIndex + set[SetLengthIndex]; 1915ch1 = set[index]; 1918ch2 = (char)(set[index + 1] - 1); 1948set[index] == 0) 1967while (index < SetStartIndex + set[SetLengthIndex] + set[CategoryLengthIndex]) 1969ch1 = set[index];
src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexNode.cs (4)
1285while (c < minLength && startingSpan[c] == startingNode.Str[c]) c++; 1344node.Ch = node.Str[node.Str.Length - 1]; 1717while (matchingCharsInMulti < nextNode.Str.Length && currentNode.Ch == nextNode.Str[matchingCharsInMulti]) 1744nextNode.Ch = nextNode.Str[nextNode.Str.Length - 1];
src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexParser.cs (81)
243while (i < input.Length && input[i] != '\\') 292while (_pos < _pattern.Length && (!IsSpecialOrSpace(ch = _pattern[_pos]) || (ch == '{' && !IsTrueQuantifier()))) 297while (_pos < _pattern.Length && (!IsSpecial(ch = _pattern[_pos]) || (ch == '{' && !IsTrueQuantifier()))) 309else if (IsSpecial(ch = _pattern[_pos])) 332_unit = RegexNode.CreateOneWithCaseConversion(_pattern[endpos - 1], _options, _culture, ref _caseBehavior); 434ch = _pattern[_pos++]; 461if (_pos < _pattern.Length && _pattern[_pos] == ',') 464max = _pos == _pattern.Length || _pattern[_pos] == '}' ? int.MaxValue : ScanDecimal(); 468if (startpos == _pos || _pos == _pattern.Length || _pattern[_pos++] != '}') 486if (_pos < _pattern.Length && _pattern[_pos] == '?') 557if (_pos < _pattern.Length && _pattern[_pos] == '^') 564if ((_options & RegexOptions.ECMAScript) != 0 && _pattern[_pos] == ']') 573ch = _pattern[_pos++]; 584switch (ch = _pattern[_pos++]) 682if (_pos < _pattern.Length && _pattern[_pos] != ']') 698else if (_pos + 1 < _pattern.Length && _pattern[_pos] == '-' && _pattern[_pos + 1] != ']') 705else if (_pos < _pattern.Length && ch == '-' && !translatedChar && _pattern[_pos] == '[' && !firstChar) 715if (_pos < _pattern.Length && _pattern[_pos] != ']') 754if (_pos == _pattern.Length || _pattern[_pos] != '?' || (_pos + 1 < _pattern.Length && _pattern[_pos + 1] == ')')) 778char ch = _pattern[_pos++]; 813switch (ch = _pattern[_pos++]) 855if (_pos < _pattern.Length && !(_pattern[_pos] == close || _pattern[_pos] == '-')) 875if (_pos < _pattern.Length && !(_pattern[_pos] == close || _pattern[_pos] == '-')) 892if ((capnum != -1 || proceed) && _pos + 1 < _pattern.Length && _pattern[_pos] == '-') 895ch = _pattern[_pos]; 907if (_pos < _pattern.Length && _pattern[_pos] != close) 921if (_pos < _pattern.Length && _pattern[_pos] != close) 935if ((capnum != -1 || uncapnum != -1) && _pos < _pattern.Length && _pattern[_pos++] == close) 949ch = _pattern[_pos]; 955if (_pos < _pattern.Length && _pattern[_pos++] == ')') 971if (_capnames?[capname] is int tmpCapnum && _pos < _pattern.Length && _pattern[_pos++] == ')') 982if (_pos + 2 < _pattern.Length && _pattern[_pos + 1] == '?') 985if (_pattern[_pos + 2] == '#') 991if (_pattern[_pos + 2] == '\'' || (_pos + 3 < _pattern.Length && _pattern[_pos + 2] == '<' && _pattern[_pos + 3] != '!' && _pattern[_pos + 3] != '=')) 1014if ((ch = _pattern[_pos++]) == ')') 1043while (_pos < _pattern.Length && IsSpace(_pattern[_pos])) 1049if ((_options & RegexOptions.IgnorePatternWhitespace) != 0 && _pos < _pattern.Length && _pattern[_pos] == '#') 1057else if (_pos + 2 < _pattern.Length && _pattern[_pos + 2] == '#' && _pattern[_pos + 1] == '?' && _pattern[_pos] == '(') 1081switch (ch = _pattern[_pos]) 1158char ch = _pattern[_pos]; 1167ch = _pattern[_pos++]; 1180ch = _pattern[_pos]; 1190ch = _pattern[_pos]; 1199if (_pos < _pattern.Length && _pattern[_pos++] == close) 1225if (_pos == _pattern.Length || (ch = _pattern[_pos]) < '0' || ch > '9') 1265if (_pos < _pattern.Length && _pattern[_pos++] == close) 1292char ch = _pattern[_pos]; 1303ch = _pattern[_pos]; 1325while (_pos < _pattern.Length && (ch = _pattern[_pos]) >= '0' && ch <= '9') 1351if (!angled || _pos < _pattern.Length && _pattern[_pos++] == '}') 1363if (_pos < _pattern.Length && _pattern[_pos++] == '}') 1422if (!RegexCharClass.IsBoundaryWordChar(_pattern[_pos++])) 1439for (i = 0; c > 0 && (uint)(d = _pattern[_pos] - '0') <= 7; c -= 1) 1462while (_pos < _pattern.Length && (uint)(d = (char)(_pattern[_pos] - '0')) <= 9) 1486char ch = _pattern[_pos++]; 1513char ch = _pattern[_pos++]; 1535char ch = _pattern[_pos]; 1576char ch = _pattern[_pos++]; 1625char ch = _pattern[_pos++]; 1634ch = _pattern[_pos++]; 1644if (_pos == _pattern.Length || _pattern[_pos++] != '}') 1677char ch = _pattern[_pos++]; 1707if (_pos + 1 < _pattern.Length && _pattern[_pos + 1] == '#' && _pattern[_pos] == '?') 1716if (_pos < _pattern.Length && _pattern[_pos] == '?') 1721if (_pos + 1 < _pattern.Length && (_pattern[_pos] == '<' || _pattern[_pos] == '\'')) 1726ch = _pattern[_pos]; 1750if (_pattern[_pos] == ')') 1756else if (_pattern[_pos] == '(') 1979char ch = _pattern[startpos]; 2018_concatenation!.AddChild(RegexNode.CreateOneWithCaseConversion(_pattern[pos], isReplacement ? _options & ~RegexOptions.IgnoreCase : _options, _culture, ref _caseBehavior));
src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexPrefixAnalyzer.cs (1)
627string setString = RegexCharClass.OneToStringClass(s[i]);
System.Web.HttpUtility (3)
System\Web\HttpUtility.cs (2)
101if (valuePos == -1 && query[q] == '=') 105else if (query[q] == '&')
System\Web\Util\HttpEncoder.cs (1)
489char ch = value[i];
System.Windows.Controls.Ribbon (2)
Microsoft\Windows\Controls\KeyTipService.cs (1)
550return _autoGenerationKeyTipPrefix + QatKeyTipCharacters[alphaIndex];
Microsoft\Windows\Controls\Ribbon\RibbonHelper.cs (1)
410if (index + 1 < length && text[index + 1] != '_')
System.Windows.Forms (51)
System\Resources\ResXFileRef.cs (6)
61if ((path1[i] != path2[i]) 62&& (compareCase || (char.ToLower(path1[i], CultureInfo.InvariantCulture) != char.ToLower(path2[i], CultureInfo.InvariantCulture)))) 67if (path1[i] == Path.DirectorySeparatorChar) 87if (path1[i] == Path.DirectorySeparatorChar)
System\Windows\Forms\Accessibility\LabelEditUiaTextProvider.cs (1)
113char ch = text[startCharIndex];
System\Windows\Forms\ActiveX\Control.ActiveXImpl.cs (2)
524switch (text[i]) 531sb.Append(text[i]);
System\Windows\Forms\Control.cs (1)
6389char c1 = char.ToUpper(text[pos], CultureInfo.CurrentCulture);
System\Windows\Forms\Controls\ComboBox\ComboBox.ComboBoxUiaTextProvider.cs (1)
168char ch = text[startCharIndex];
System\Windows\Forms\Controls\DataGridView\DataGridViewCell.cs (2)
1173char ch = s[i]; 1233char ch = s[i];
System\Windows\Forms\Controls\RichTextBox\RichTextBox.cs (3)
1829while (FindInternal(kashidaString, foundCursor, foundCursor + 1, options) != -1 && str[searchingCursor] != kashida) 2059bool found = GetCharInCharSet(str[x], characterSet, negate); 2077bool found = GetCharInCharSet(str[x], characterSet, negate);
System\Windows\Forms\Controls\TabControl\TabControl.cs (3)
2189if (value[i] == '&') 2191if (i < value.Length - 1 && value[i + 1] == '&') 2201newString.Append(value[i]);
System\Windows\Forms\Controls\TextBox\TextBoxBase.cs (4)
586char c = text[lineEnd]; 597if (lineEnd < text.Length && text[lineEnd] == '\r') 602if (lineEnd < text.Length && text[lineEnd] == '\n') 1565return (index < 0 || index >= t.Length) ? (char)0 : t[index];
System\Windows\Forms\Controls\TextBox\TextBoxBase.TextBoxBaseUiaTextProvider.cs (1)
317char ch = text[startCharIndex];
System\Windows\Forms\Dialogs\ThreadExceptionDialog.cs (1)
398while (i > 0 && s[i - 1] == '.')
System\Windows\Forms\Internal\WinFormsUtils.cs (8)
139if (text[index] == '&') 144str.Append(text[index]); 207if (text[i] == '&') 209if (text[i + 1] == '&') 218mnemonic = char.ToUpper(text[i + 1], CultureInfo.CurrentCulture); 222mnemonic = char.ToLower(text[i + 1], CultureInfo.CurrentCulture); 261if (text[index] == '&') 269str.Append(text[index]);
System\Windows\Forms\Panels\TableLayoutPanel\TableLayoutSettingsTypeConverter.cs (7)
192while (char.IsLetter(styleString[nextIndex])) 201while (!char.IsDigit(styleString[nextIndex])) 208while ((nextIndex < styleString.Length) && (char.IsDigit(styleString[nextIndex]))) 210floatStringBuilder.Append(styleString[nextIndex]); 217while ((nextIndex < styleString.Length) && (!char.IsLetter(styleString[nextIndex]))) 219if (char.IsDigit(styleString[nextIndex])) 221floatStringBuilder.Append(styleString[nextIndex]);
System\Windows\Forms\SendKeys\SendKeys.cs (11)
398char ch = keys[i]; 414if (j + 1 < keysLen && keys[j] == '}') 418while (final < keysLen && keys[final] != '}') 432while (j < keysLen && keys[j] != '}' 433&& !char.IsWhiteSpace(keys[j])) 447if (char.IsWhiteSpace(keys[j])) 450while (j < keysLen && char.IsWhiteSpace(keys[j])) 460if (char.IsDigit(keys[j])) 463while (j < keysLen && char.IsDigit(keys[j])) 477if (keys[j] != '}') 608s_startNewChar = AddSimpleKey(keys[i], repeat, hwnd, haveKeys, s_startNewChar, cGrp);
System.Windows.Forms.Analyzers.CSharp (1)
System\Windows\Forms\CSharp\Generators\ApplicationConfiguration\ProjectFileReader.FontConverter.cs (1)
150if (char.IsLetter(text[splitPoint]))
System.Windows.Forms.Design (12)
System\ComponentModel\Design\DesignerActionPanel.cs (2)
759if (s[i] == '&') 771result.Append(s[i]);
System\ComponentModel\Design\DesignerHost.cs (1)
567&& className.Length > oldName.Length && className[className.Length - oldName.Length - 1] == '.')
System\ComponentModel\Design\MultilineStringEditor.MultilineStringEditorUI.cs (4)
285low = value[currentSurrogate + 1]; 288if (value[currentSurrogate] < 0xD800 || value[currentSurrogate] > 0xDBFF || low < 0xDC00 || low > 0xDFFF) 294int planeNumber = (value[currentSurrogate] / 0x40) - (0xD800 / 0x40) + 1;
System\ComponentModel\Design\Serialization\CodeDomDesignerLoader.cs (3)
1021if (char.IsUpper(baseName[i]) && (i == 0 || i == baseName.Length - 1 || char.IsUpper(baseName[i + 1]))) 1023span[i] = char.ToLower(baseName[i], CultureInfo.CurrentCulture);
System\Windows\Forms\Design\StandardMenuStripVerb.cs (1)
467char c = text[i];
System\Windows\Forms\Design\ToolStripDesigner.cs (1)
1734char c = text[i];
System.Windows.Forms.Primitives (7)
System\Windows\Forms\Automation\UiaTextRange.cs (6)
360&& End - Start == 1 && text[End] == '\n')) 645=> string.IsNullOrWhiteSpace(text) || index <= 0 || index >= text.Length || ((text[index - 1] == '\n') && (text[index] != '\n')); 659char ch1 = text[index - 1]; 660char ch2 = text[index]; 664|| (IsApostrophe(ch1) && char.IsLetterOrDigit(ch2) && index >= 2 && char.IsLetterOrDigit(text[index - 2])))
System\Windows\Forms\Internals\ClientUtils.cs (1)
30char character = text[index];
System.Windows.Forms.UI.IntegrationTests (3)
Infra\SendInput.cs (1)
32if (text[index] == '\r')
Input\KeyboardSimulator.cs (2)
76inputs[i * 2] = InputBuilder.CharacterDown(text[i]); 77inputs[i * 2 + 1] = InputBuilder.CharacterUp(text[i]);
System.Xaml (27)
System\Xaml\NameValidationHelper.cs (2)
34uc = char.GetUnicodeCategory(name[i]); 40name[i] == '_');
System\Xaml\Parser\GenericTypeNameScanner.cs (1)
350get { return _inputText[_idx]; }
System\Xaml\Parser\MeScanner.cs (3)
275builder.Append(value[idx + 1]); 533get { return _inputText[_idx]; } 542return _inputText[_idx + 1];
System\Xaml\Parser\XamlName.cs (1)
58if (!IsValidNameChar(name[i]))
System\Xaml\Parser\XamlQualifiedName.cs (2)
39if (!IsValidQualifiedNameChar(name[i])) 62if (!IsValidQualifiedNameCharPlus(name[i]))
System\Xaml\Parser\XamlText.cs (9)
117bool textHadTrailingWhitespace = IsWhitespaceChar(text[text.Length - 1]); 186if (!IsWhitespaceChar(text[i])) 208char ch = text[firstIdx]; 220if (!IsWhitespaceChar(text[advancingIdx])) 232if ((advancingIdx - firstIdx == 2) && text[firstIdx - 1] >= 0x1100) 288afterValue = text[end]; 309char highChar = text[takeTwoIdx]; 312char lowChar = text[takeTwoIdx + 1]; 322unicodeScalarValue = text[takeOneIdx];
System\Xaml\XamlMarkupExtensionWriter.cs (3)
263if (s[i] == '\\' || s[i] == '"') 268sb.Append(s[i]);
System\Xaml\XamlXmlWriter.cs (6)
309return s[s.Length - 1] == KnownStrings.SpaceChar; 316if (s[i] == KnownStrings.SpaceChar && s[i + 1] == KnownStrings.SpaceChar) 329if (s[i] == KnownStrings.TabChar || s[i] == KnownStrings.NewlineChar || s[i] == KnownStrings.ReturnChar)
Templates.Blazor.Tests (4)
src\ProjectTemplates\Shared\ProjectFactoryFixture.cs (1)
61private static char GetRandomLetter() => LetterChars[Random.Shared.Next(LetterChars.Length - 1)];
src\Shared\CommandLineUtils\CommandLine\AnsiConsole.cs (3)
78message[endIndex] >= 0x20 && 79message[endIndex] <= 0x3f) 91switch (message[endIndex])
Templates.Blazor.WebAssembly.Auth.Tests (4)
src\ProjectTemplates\Shared\ProjectFactoryFixture.cs (1)
61private static char GetRandomLetter() => LetterChars[Random.Shared.Next(LetterChars.Length - 1)];
src\Shared\CommandLineUtils\CommandLine\AnsiConsole.cs (3)
78message[endIndex] >= 0x20 && 79message[endIndex] <= 0x3f) 91switch (message[endIndex])
Templates.Blazor.WebAssembly.Tests (4)
src\ProjectTemplates\Shared\ProjectFactoryFixture.cs (1)
61private static char GetRandomLetter() => LetterChars[Random.Shared.Next(LetterChars.Length - 1)];
src\Shared\CommandLineUtils\CommandLine\AnsiConsole.cs (3)
78message[endIndex] >= 0x20 && 79message[endIndex] <= 0x3f) 91switch (message[endIndex])
Templates.Mvc.Tests (4)
src\ProjectTemplates\Shared\ProjectFactoryFixture.cs (1)
61private static char GetRandomLetter() => LetterChars[Random.Shared.Next(LetterChars.Length - 1)];
src\Shared\CommandLineUtils\CommandLine\AnsiConsole.cs (3)
78message[endIndex] >= 0x20 && 79message[endIndex] <= 0x3f) 91switch (message[endIndex])
Templates.Tests (4)
src\ProjectTemplates\Shared\ProjectFactoryFixture.cs (1)
61private static char GetRandomLetter() => LetterChars[Random.Shared.Next(LetterChars.Length - 1)];
src\Shared\CommandLineUtils\CommandLine\AnsiConsole.cs (3)
78message[endIndex] >= 0x20 && 79message[endIndex] <= 0x3f) 91switch (message[endIndex])
Test.Utilities (109)
src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (12)
53while (lastSeparator > 0 && IsDirectorySeparator(s[lastSeparator - 1])) 71if (s.Length == 0 || IsAnyDirectorySeparator(s[s.Length - 1])) 145if (IsDirectorySeparator(path[i])) 147if (i > 0 && IsDirectorySeparator(path[i - 1])) 240if (!IsDirectorySeparator(path[i])) 276while (i < length && IsDirectorySeparator(path[i])) 440char c = root[root.Length - 1]; 479if (path.Length > 0 && IsDirectorySeparator(path[path.Length - 1])) 611&& (IsDirectorySeparator(parentPath[parentPath.Length - 1]) || IsDirectorySeparator(childPath[parentPath.Length])); 663if (!PathCharEqual(path1[i], path2[i]))
src\Compilers\Core\Portable\InternalUtilities\FileNameUtilities.cs (2)
122if (path.Length > 0 && path[path.Length - 1] == '.') 175char ch = path[i];
src\Compilers\Core\Portable\InternalUtilities\StringExtensions.cs (7)
173char c = str[i++]; 178if (i < str.Length && char.IsLowSurrogate(str[i])) 208if (arg.Length > 1 && arg[0] == '"' && arg[arg.Length - 1] == '"') 224char.ToUpper(string1[x]) == char.ToUpper(string2[x])) 236string1[x] == string2[x])
src\Compilers\Core\Portable\InternalUtilities\StringTable.cs (3)
489if (array[i] != text[start + i]) 545if (ascii[i] != text[i])
src\Compilers\Core\Portable\InternalUtilities\UnicodeCharacterUtilities.cs (1)
106if (!IsIdentifierPartCharacter(name[i]))
src\Compilers\Core\Portable\Syntax\SyntaxTreeExtensions.cs (4)
65found = fromNode[index]; 66expected = fromText[index]; 100if (s1[i] != s2[i])
src\RoslynAnalyzers\Utilities\Compiler\Options\AnalyzerOptionsExtensions.cs (1)
365if (trimmedSuffix[i] != ' ')
src\RoslynAnalyzers\Utilities\Compiler\WellKnownTypeProvider.cs (2)
222if (fullTypeName[i] == '.') 227else if (!IsIdentifierPartCharacter(fullTypeName[i]))
src\RoslynAnalyzers\Utilities\Compiler\WordParser.cs (2)
558char c = _text[_index++]; 576char c = _text[index];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher.Lexer.cs (6)
26if (headerText[Position] == '\\') 80switch (headerText[position]) 86headerText[position] == '*') 124public readonly char CurrentCharacter => headerText[Position]; 126public char EatCurrentCharacter() => headerText[Position++]; 142public readonly char this[int position] => headerText[position];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\AbstractVirtualCharService.cs (6)
33var ch = tokenText[index]; 34var next = tokenText[index + 1]; 165if (tokenText[index] == '"' && tokenText[index + 1] == '"') 171else if (escapeBraces && IsOpenOrCloseBrace(tokenText[index])) 176result.Add(VirtualChar.Create(new Rune(tokenText[index]), span));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\AbstractVirtualCharService.ITextInfo.cs (1)
29public readonly char Get(string text, int index) => text[index];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\VirtualCharSequence.Chunks.cs (3)
102if (char.IsHighSurrogate(data[index])) 105!char.IsLowSurrogate(data[index + 1])); 110var ch = data[index];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\StringExtensions.cs (8)
20if (!char.IsWhiteSpace(line[i])) 35if (!char.IsWhiteSpace(line[i])) 87if (textSnippet[i] == '\t') 109if (predicate(text[i])) 158if (text[i] == '\n') 162else if (text[i] == '\r') 164if (i + 1 == text.Length || text[i + 1] != '\n') 230if (line[i] == '\t')
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\FormattingExtensions.cs (3)
228if (text[i] is not ' ' and not '\t') 245if (i >= newText.Length || text[i] != newText[i])
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\TriviaEngine\AbstractTriviaFormatter.cs (5)
147if (!IsWhitespace(text[i]) || !IsNewLine(text[i])) 503if (!char.IsWhiteSpace(this.OriginalString[i])) 533if (!IsWhitespace(this.OriginalString[i])) 743if (this.OriginalString[i] == '\n')
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.cs (11)
180private static readonly Func<string, TextSpan, bool> s_firstCharIsLowerCase = (val, span) => !DoesCharacterHaveCasing(val[span.Start]) || char.IsLower(val[span.Start]); 181private static readonly Func<string, TextSpan, bool> s_firstCharIsUpperCase = (val, span) => !DoesCharacterHaveCasing(val[span.Start]) || char.IsUpper(val[span.Start]); 187if (DoesCharacterHaveCasing(val[i]) && !char.IsUpper(val[i])) 200if (DoesCharacterHaveCasing(val[i]) && !char.IsLower(val[i])) 348switch (char.ToLowerInvariant(name[index])) 353if (index + 2 < name.Length && name[index + 1] == '_') 362if (index + 1 < name.Length && !char.IsDigit(name[index + 1]))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\ISyntaxFactsExtensions.cs (1)
263if (!syntaxFacts.IsIdentifierPartCharacter(name[i]))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (16)
65Debug.Assert(Data[Position] == c); 87Debug.Assert(char.IsNumber(Data[Position])); 92while (char.IsNumber(Data[Position])) 94var digit = Data[Position] - '0'; 139if ((SymbolKeyType)Data[Position] == SymbolKeyType.Null) 152if (Data[Position] != DoubleQuoteChar) 160if (Data[Position + 1] == DoubleQuoteChar) 202Debug.Assert((SymbolKeyType)Data[Position] != SymbolKeyType.Null); 261var ch = Data[Position]; 266var type = (SymbolKeyType)Data[Position]; 272else if (Data[Position] == DoubleQuoteChar) 306_builder.Append(Data[i]); 474var type = (SymbolKeyType)Data[Position]; 485type = (SymbolKeyType)Data[Position]; 547Debug.Assert((SymbolKeyType)Data[Position] != SymbolKeyType.Null); 646if ((SymbolKeyType)Data[Position] == SymbolKeyType.Null)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\Base64Utilities.cs (1)
338while (index >= 0 && attributeData[index] == '=')
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BKTree.cs (1)
79lowerCaseCharacters[i] = CaseInsensitiveComparison.ToLower(value[i]);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EditDistance.cs (2)
62array[i] = CaseInsensitiveComparison.ToLower(text[i]); 94targetLowerCaseCharacters[i] = CaseInsensitiveComparison.ToLower(target[i]);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\StringBreaker.cs (9)
46var firstChar = identifier[wordStart]; 86var c = identifier[current]; 108var c = identifier[current]; 118while (current < length && char.IsUpper(identifier[current])) 123if (current < length && IsLower(identifier[current])) 126Debug.Assert(char.IsUpper(identifier[current - 1])); 153while (current < length && IsLower(identifier[current])) 164while (current < length && char.IsDigit(identifier[current])) 176var ch = identifier[wordStart];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\StringEscapeEncoder.cs (2)
46builder.AppendFormat("{0:X2}", (int)text[index]); 105var ch = text[i];
Text.Analyzers (112)
src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (12)
53while (lastSeparator > 0 && IsDirectorySeparator(s[lastSeparator - 1])) 71if (s.Length == 0 || IsAnyDirectorySeparator(s[s.Length - 1])) 145if (IsDirectorySeparator(path[i])) 147if (i > 0 && IsDirectorySeparator(path[i - 1])) 240if (!IsDirectorySeparator(path[i])) 276while (i < length && IsDirectorySeparator(path[i])) 440char c = root[root.Length - 1]; 479if (path.Length > 0 && IsDirectorySeparator(path[path.Length - 1])) 611&& (IsDirectorySeparator(parentPath[parentPath.Length - 1]) || IsDirectorySeparator(childPath[parentPath.Length])); 663if (!PathCharEqual(path1[i], path2[i]))
src\Compilers\Core\Portable\InternalUtilities\FileNameUtilities.cs (2)
122if (path.Length > 0 && path[path.Length - 1] == '.') 175char ch = path[i];
src\Compilers\Core\Portable\InternalUtilities\StringExtensions.cs (7)
173char c = str[i++]; 178if (i < str.Length && char.IsLowSurrogate(str[i])) 208if (arg.Length > 1 && arg[0] == '"' && arg[arg.Length - 1] == '"') 224char.ToUpper(string1[x]) == char.ToUpper(string2[x])) 236string1[x] == string2[x])
src\Compilers\Core\Portable\InternalUtilities\StringTable.cs (4)
489if (array[i] != text[start + i]) 519if (array[i] != text[i]) 545if (ascii[i] != text[i])
src\Compilers\Core\Portable\InternalUtilities\UnicodeCharacterUtilities.cs (1)
106if (!IsIdentifierPartCharacter(name[i]))
src\Compilers\Core\Portable\Syntax\SyntaxTreeExtensions.cs (4)
65found = fromNode[index]; 66expected = fromText[index]; 100if (s1[i] != s2[i])
src\RoslynAnalyzers\Utilities\Compiler\Options\AnalyzerOptionsExtensions.cs (1)
365if (trimmedSuffix[i] != ' ')
src\RoslynAnalyzers\Utilities\Compiler\WellKnownTypeProvider.cs (2)
222if (fullTypeName[i] == '.') 227else if (!IsIdentifierPartCharacter(fullTypeName[i]))
src\RoslynAnalyzers\Utilities\Compiler\WordParser.cs (2)
558char c = _text[_index++]; 576char c = _text[index];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher.Lexer.cs (6)
26if (headerText[Position] == '\\') 80switch (headerText[position]) 86headerText[position] == '*') 124public readonly char CurrentCharacter => headerText[Position]; 126public char EatCurrentCharacter() => headerText[Position++]; 142public readonly char this[int position] => headerText[position];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\AbstractVirtualCharService.cs (6)
33var ch = tokenText[index]; 34var next = tokenText[index + 1]; 165if (tokenText[index] == '"' && tokenText[index + 1] == '"') 171else if (escapeBraces && IsOpenOrCloseBrace(tokenText[index])) 176result.Add(VirtualChar.Create(new Rune(tokenText[index]), span));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\AbstractVirtualCharService.ITextInfo.cs (1)
29public readonly char Get(string text, int index) => text[index];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\VirtualCharSequence.Chunks.cs (3)
102if (char.IsHighSurrogate(data[index])) 105!char.IsLowSurrogate(data[index + 1])); 110var ch = data[index];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\StringExtensions.cs (8)
20if (!char.IsWhiteSpace(line[i])) 35if (!char.IsWhiteSpace(line[i])) 87if (textSnippet[i] == '\t') 109if (predicate(text[i])) 158if (text[i] == '\n') 162else if (text[i] == '\r') 164if (i + 1 == text.Length || text[i + 1] != '\n') 230if (line[i] == '\t')
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\FormattingExtensions.cs (3)
228if (text[i] is not ' ' and not '\t') 245if (i >= newText.Length || text[i] != newText[i])
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\TriviaEngine\AbstractTriviaFormatter.cs (5)
147if (!IsWhitespace(text[i]) || !IsNewLine(text[i])) 503if (!char.IsWhiteSpace(this.OriginalString[i])) 533if (!IsWhitespace(this.OriginalString[i])) 743if (this.OriginalString[i] == '\n')
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.cs (11)
180private static readonly Func<string, TextSpan, bool> s_firstCharIsLowerCase = (val, span) => !DoesCharacterHaveCasing(val[span.Start]) || char.IsLower(val[span.Start]); 181private static readonly Func<string, TextSpan, bool> s_firstCharIsUpperCase = (val, span) => !DoesCharacterHaveCasing(val[span.Start]) || char.IsUpper(val[span.Start]); 187if (DoesCharacterHaveCasing(val[i]) && !char.IsUpper(val[i])) 200if (DoesCharacterHaveCasing(val[i]) && !char.IsLower(val[i])) 348switch (char.ToLowerInvariant(name[index])) 353if (index + 2 < name.Length && name[index + 1] == '_') 362if (index + 1 < name.Length && !char.IsDigit(name[index + 1]))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\ISyntaxFactsExtensions.cs (1)
263if (!syntaxFacts.IsIdentifierPartCharacter(name[i]))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (16)
65Debug.Assert(Data[Position] == c); 87Debug.Assert(char.IsNumber(Data[Position])); 92while (char.IsNumber(Data[Position])) 94var digit = Data[Position] - '0'; 139if ((SymbolKeyType)Data[Position] == SymbolKeyType.Null) 152if (Data[Position] != DoubleQuoteChar) 160if (Data[Position + 1] == DoubleQuoteChar) 202Debug.Assert((SymbolKeyType)Data[Position] != SymbolKeyType.Null); 261var ch = Data[Position]; 266var type = (SymbolKeyType)Data[Position]; 272else if (Data[Position] == DoubleQuoteChar) 306_builder.Append(Data[i]); 474var type = (SymbolKeyType)Data[Position]; 485type = (SymbolKeyType)Data[Position]; 547Debug.Assert((SymbolKeyType)Data[Position] != SymbolKeyType.Null); 646if ((SymbolKeyType)Data[Position] == SymbolKeyType.Null)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\Base64Utilities.cs (1)
338while (index >= 0 && attributeData[index] == '=')
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BKTree.cs (1)
79lowerCaseCharacters[i] = CaseInsensitiveComparison.ToLower(value[i]);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EditDistance.cs (2)
62array[i] = CaseInsensitiveComparison.ToLower(text[i]); 94targetLowerCaseCharacters[i] = CaseInsensitiveComparison.ToLower(target[i]);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\StringBreaker.cs (9)
46var firstChar = identifier[wordStart]; 86var c = identifier[current]; 108var c = identifier[current]; 118while (current < length && char.IsUpper(identifier[current])) 123if (current < length && IsLower(identifier[current])) 126Debug.Assert(char.IsUpper(identifier[current - 1])); 153while (current < length && IsLower(identifier[current])) 164while (current < length && char.IsDigit(identifier[current])) 176var ch = identifier[wordStart];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\StringEscapeEncoder.cs (2)
46builder.AppendFormat("{0:X2}", (int)text[index]); 105var ch = text[i];
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (1)
373if (p.Length > 0 && char.IsLetter(name[p.Start]))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\TypeInferenceService\AbstractTypeInferenceService.cs (1)
72var nextChar = name[prefix.Length];
UIAutomationClient (2)
MS\Internal\Automation\CacheHelper.cs (2)
148char c = treeDescription[index]; 223if (treeDescription[index] != ')')
UIAutomationClientSideProviders (15)
MS\Internal\AutomationProxies\Misc.cs (1)
47return SR.KeyAlt + "+" + s[iPosShortCut + 1];
MS\Internal\AutomationProxies\WindowsEditBox.cs (1)
757char ch = text[index];
MS\Internal\AutomationProxies\WindowsEditBoxRange.cs (5)
545return index <= 0 || index >= text.Length || (text[index - 1]=='\n') && (text[index]!='\n'); 569char ch1 = text[index - 1]; 570char ch2 = text[index]; 574|| (IsApostrophe(ch1) && char.IsLetterOrDigit(ch2) && index >= 2 && char.IsLetterOrDigit(text[index - 2])))
MS\Internal\AutomationProxies\WindowsMenu.cs (8)
1361if (pos > 0 && pos + keywordsAccelerators[i].Length == menuText.Length && (menuText[pos - 1] == '\a' || menuText[pos - 1] == '\t')) 1555return s[iPosShortCut + 1].ToString(); 2449return string.Format(CultureInfo.CurrentCulture, "{0}{1}{2}", sCanonicalsKeyword, menuText.Substring(pos + cKeyChars + 1, cMenuChars - (pos + cKeyChars + 2)), Char.ToUpper(menuText[cMenuChars - 1], CultureInfo.InvariantCulture)); 2492while (iStart - 1 >= 0 && ((ch = s[iStart - 1]) == ' ' || ch == '\t' || ch == '\a')) 2696return name[hotKeyStart + 1]; 2775if (pos > 0 && pos + keywordsAccelerators[i].Length == menuText.Length && (menuText[pos - 1] == '\a' || menuText[pos - 1] == '\t'))
Wasm.Performance.ConsoleHost (3)
src\Shared\CommandLineUtils\CommandLine\AnsiConsole.cs (3)
78message[endIndex] >= 0x20 && 79message[endIndex] <= 0x3f) 91switch (message[endIndex])
XmlFileLogger (1)
ItemGroupParser.cs (1)
101while (result < line.Length && line[result] == ' ')
xunit.assert (2)
Sdk\ArgumentFormatter.cs (1)
159 var ch = s[i];
Sdk\AssertHelper.cs (1)
235 var c = value[idx];
xunit.console (3)
CommandLine.cs (2)
132var ch = line[j]; 143ch = line[j];
common\Json.cs (1)
227if (next != literal[i])