if ((options & ValidIndexMaskOffFlags) != 0 && (options != CompareOptions.Ordinal && options != CompareOptions.OrdinalIgnoreCase))
throw new ArgumentException(SR.Argument_InvalidFlag, nameof(options));
- return IndexOf(source, new string(value, 1), startIndex, count, options, null);
+ return IndexOf(source, char.ToString(value), startIndex, count, options, null);
}
public unsafe virtual int IndexOf(string source, string value, int startIndex, int count, CompareOptions options)
}
if (GlobalizationMode.Invariant)
- return InvariantLastIndexOf(source, new string(value, 1), startIndex, count, (options & (CompareOptions.IgnoreCase | CompareOptions.OrdinalIgnoreCase)) != 0);
+ return InvariantLastIndexOf(source, char.ToString(value), startIndex, count, (options & (CompareOptions.IgnoreCase | CompareOptions.OrdinalIgnoreCase)) != 0);
return LastIndexOfCore(source, value.ToString(), startIndex, count, options);
}
nfi.nativeDigits = new string[10];
for (int i = 0; i < nfi.nativeDigits.Length; i++)
{
- nfi.nativeDigits[i] = new string(digits[i], 1);
+ nfi.nativeDigits[i] = char.ToString(digits[i]);
}
nfi.digitSubstitution = GetDigitSubstitution(_sRealName);
case 'O':
case 's':
case 'u':
- results = new string[] { Format(dateTime, new string(format, 1), dtfi) };
+ results = new string[] { Format(dateTime, char.ToString(format), dtfi) };
break;
default:
throw new FormatException(SR.Format_InvalidString);