// We set prefixLookup to true if name ends with a "*".
// We will also set listType to All so that all members are included in
// the candidates which are later filtered by FilterApplyPrefixLookup.
- name = name.Substring(0, name.Length - 1);
+ name = name[0..^1];
prefixLookup = true;
listType = MemberListType.All;
}
if (str[str.Length - 1] == '.')
{
// Old version ignore the trailing dot in the date words. Support this as well.
- string strWithoutDot = str.Substring(0, str.Length - 1);
+ string strWithoutDot = str[0..^1];
if (!m_dateWords.Contains(strWithoutDot))
{
m_dateWords.Add(strWithoutDot);
{
arrayEncodingInfo[i] = new EncodingInfo(
s_mappedCodePages[i],
- s_webNames.Substring(s_webNameIndices[i], s_webNameIndices[i + 1] - s_webNameIndices[i]),
+ s_webNames[s_webNameIndices[i]..s_webNameIndices[i + 1]],
GetDisplayName(s_mappedCodePages[i], i)
);
}
private static CodePageDataItem InternalGetCodePageDataItem(int codePage, int index)
{
int uiFamilyCodePage = s_uiFamilyCodePages[index];
- string webName = s_webNames.Substring(s_webNameIndices[index], s_webNameIndices[index + 1] - s_webNameIndices[index]);
+ string webName = s_webNames[s_webNameIndices[index]..s_webNameIndices[index + 1]];
// All supported code pages have identical header names, and body names.
string headerName = webName;
string bodyName = webName;
{
string? displayName = SR.GetResourceString("Globalization_cp_" + codePage.ToString());
if (string.IsNullOrEmpty(displayName))
- displayName = s_englishNames.Substring(s_englishNameIndices[englishNameIndex], s_englishNameIndices[englishNameIndex + 1] - s_englishNameIndices[englishNameIndex]);
+ displayName = s_englishNames[s_englishNameIndices[englishNameIndex]..s_englishNameIndices[englishNameIndex + 1]];
return displayName;
}