// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
+#nullable enable
using System.Diagnostics;
using System.Globalization;
using System.Numerics;
// to determine whether it is lexicographically less, equal, or greater, and then returns
// either a negative integer, 0, or a positive integer; respectively.
//
- public static int Compare(string strA, string strB)
+ public static int Compare(string? strA, string? strB)
{
return Compare(strA, strB, StringComparison.CurrentCulture);
}
// negative integer, 0, or a positive integer is returned; respectively.
// The case-sensitive option is set by ignoreCase
//
- public static int Compare(string strA, string strB, bool ignoreCase)
+ public static int Compare(string? strA, string? strB, bool ignoreCase)
{
var comparisonType = ignoreCase ? StringComparison.CurrentCultureIgnoreCase : StringComparison.CurrentCulture;
return Compare(strA, strB, comparisonType);
// Provides a more flexible function for string comparison. See StringComparison
// for meaning of different comparisonType.
- public static int Compare(string strA, string strB, StringComparison comparisonType)
+ public static int Compare(string? strA, string? strB, StringComparison comparisonType)
{
if (object.ReferenceEquals(strA, strB))
{
// to determine whether it is lexicographically less, equal, or greater, and then a
// negative integer, 0, or a positive integer is returned; respectively.
//
- public static int Compare(string strA, string strB, CultureInfo culture, CompareOptions options)
+ public static int Compare(string? strA, string? strB, CultureInfo culture, CompareOptions options)
{
if (culture == null)
{
// The case-sensitive option is set by ignoreCase, and the culture is set
// by culture
//
- public static int Compare(string strA, string strB, bool ignoreCase, CultureInfo culture)
+ public static int Compare(string? strA, string? strB, bool ignoreCase, CultureInfo culture)
{
var options = ignoreCase ? CompareOptions.IgnoreCase : CompareOptions.None;
return Compare(strA, strB, culture, options);
// at indexA of given length is compared with the substring of strB
// beginning at indexB of the same length.
//
- public static int Compare(string strA, int indexA, string strB, int indexB, int length)
+ public static int Compare(string? strA, int indexA, string? strB, int indexB, int length)
{
// NOTE: It's important we call the boolean overload, and not the StringComparison
// one. The two have some subtly different behavior (see notes in the former).
// at indexA of given length is compared with the substring of strB
// beginning at indexB of the same length. Case sensitivity is determined by the ignoreCase boolean.
//
- public static int Compare(string strA, int indexA, string strB, int indexB, int length, bool ignoreCase)
+ public static int Compare(string? strA, int indexA, string? strB, int indexB, int length, bool ignoreCase)
{
// Ideally we would just forward to the string.Compare overload that takes
// a StringComparison parameter, and just pass in CurrentCulture/CurrentCultureIgnoreCase.
// beginning at indexB of the same length. Case sensitivity is determined by the ignoreCase boolean,
// and the culture is set by culture.
//
- public static int Compare(string strA, int indexA, string strB, int indexB, int length, bool ignoreCase, CultureInfo culture)
+ public static int Compare(string? strA, int indexA, string? strB, int indexB, int length, bool ignoreCase, CultureInfo culture)
{
var options = ignoreCase ? CompareOptions.IgnoreCase : CompareOptions.None;
return Compare(strA, indexA, strB, indexB, length, culture, options);
// at indexA of length length is compared with the substring of strB
// beginning at indexB of the same length.
//
- public static int Compare(string strA, int indexA, string strB, int indexB, int length, CultureInfo culture, CompareOptions options)
+ public static int Compare(string? strA, int indexA, string? strB, int indexB, int length, CultureInfo culture, CompareOptions options)
{
if (culture == null)
{
return culture.CompareInfo.Compare(strA, indexA, lengthA, strB, indexB, lengthB, options);
}
- public static int Compare(string strA, int indexA, string strB, int indexB, int length, StringComparison comparisonType)
+ public static int Compare(string? strA, int indexA, string? strB, int indexB, int length, StringComparison comparisonType)
{
CheckStringComparison(comparisonType);
// Compares strA and strB using an ordinal (code-point) comparison.
//
- public static int CompareOrdinal(string strA, string strB)
+ public static int CompareOrdinal(string? strA, string? strB)
{
if (object.ReferenceEquals(strA, strB))
{
// Compares strA and strB using an ordinal (code-point) comparison.
//
- public static int CompareOrdinal(string strA, int indexA, string strB, int indexB, int length)
+ public static int CompareOrdinal(string? strA, int indexA, string? strB, int indexB, int length)
{
if (strA == null || strB == null)
{
// indicates the relationship. This method returns a value less than 0 if this is less than value, 0
// if this is equal to value, or a value greater than 0 if this is greater than value.
//
- public int CompareTo(object value)
+ public int CompareTo(object? value)
{
if (value == null)
{
// Determines the sorting relation of StrB to the current instance.
//
- public int CompareTo(string strB)
+ public int CompareTo(string? strB)
{
return string.Compare(this, strB, StringComparison.CurrentCulture);
}
}
}
- public bool EndsWith(string value, bool ignoreCase, CultureInfo culture)
+ public bool EndsWith(string value, bool ignoreCase, CultureInfo? culture)
{
if (null == value)
{
}
// Determines whether two strings match.
- public override bool Equals(object obj)
+ public override bool Equals(object? obj)
{
if (object.ReferenceEquals(this, obj))
return true;
}
// Determines whether two strings match.
- public bool Equals(string value)
+ public bool Equals(string? value)
{
if (object.ReferenceEquals(this, value))
return true;
return EqualsHelper(this, value);
}
- public bool Equals(string value, StringComparison comparisonType)
+ public bool Equals(string? value, StringComparison comparisonType)
{
- if ((object)this == (object)value)
+ if (object.ReferenceEquals(this, value))
{
CheckStringComparison(comparisonType);
return true;
}
- if ((object)value == null)
+ if (value is null)
{
CheckStringComparison(comparisonType);
return false;
// Determines whether two Strings match.
- public static bool Equals(string a, string b)
+ public static bool Equals(string? a, string? b)
{
- if ((object)a == (object)b)
+ if (object.ReferenceEquals(a,b))
{
return true;
}
- if ((object)a == null || (object)b == null || a.Length != b.Length)
+ if (a is null || b is null || a.Length != b.Length)
{
return false;
}
return EqualsHelper(a, b);
}
- public static bool Equals(string a, string b, StringComparison comparisonType)
+ public static bool Equals(string? a, string? b, StringComparison comparisonType)
{
- if ((object)a == (object)b)
+ if (object.ReferenceEquals(a, b))
{
CheckStringComparison(comparisonType);
return true;
}
- if ((object)a == null || (object)b == null)
+ if (a is null || b is null)
{
CheckStringComparison(comparisonType);
return false;
}
}
- public static bool operator ==(string a, string b)
+ public static bool operator ==(string? a, string? b)
{
return string.Equals(a, b);
}
- public static bool operator !=(string a, string b)
+ public static bool operator !=(string? a, string? b)
{
return !string.Equals(a, b);
}
//
public bool StartsWith(string value)
{
- if ((object)value == null)
+ if (value is null)
{
throw new ArgumentNullException(nameof(value));
}
public bool StartsWith(string value, StringComparison comparisonType)
{
- if ((object)value == null)
+ if (value is null)
{
throw new ArgumentNullException(nameof(value));
}
}
}
- public bool StartsWith(string value, bool ignoreCase, CultureInfo culture)
+ public bool StartsWith(string value, bool ignoreCase, CultureInfo? culture)
{
if (null == value)
{
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
+#nullable enable
using System.Buffers;
using System.Collections.Generic;
using System.Diagnostics;
}
}
- public static string Concat(object arg0)
+ public static string Concat(object? arg0)
{
if (arg0 == null)
{
return arg0.ToString();
}
- public static string Concat(object arg0, object arg1)
+ public static string Concat(object? arg0, object? arg1)
{
if (arg0 == null)
{
return Concat(arg0.ToString(), arg1.ToString());
}
- public static string Concat(object arg0, object arg1, object arg2)
+ public static string Concat(object? arg0, object? arg1, object? arg2)
{
if (arg0 == null)
{
return Concat(arg0.ToString(), arg1.ToString(), arg2.ToString());
}
- public static string Concat(params object[] args)
+ public static string Concat(params object?[] args)
{
if (args == null)
{
for (int i = 0; i < args.Length; i++)
{
- object value = args[i];
+ object? value = args[i];
string toString = value?.ToString() ?? string.Empty; // We need to handle both the cases when value or value.ToString() is null
strings[i] = toString;
// Everything should be called in the order
// MoveNext-Current-ToString, unless further optimizations
// can be made, to avoid breaking changes
- string firstString = currentValue?.ToString();
+ string? firstString = currentValue?.ToString();
// If there's only 1 item, simply call ToString on that
if (!en.MoveNext())
}
}
- public static string Concat(IEnumerable<string> values)
+ public static string Concat(IEnumerable<string?> values)
{
if (values == null)
throw new ArgumentNullException(nameof(values));
- using (IEnumerator<string> en = values.GetEnumerator())
+ using (IEnumerator<string?> en = values.GetEnumerator())
{
if (!en.MoveNext())
return string.Empty;
- string firstValue = en.Current;
+ string? firstValue = en.Current;
if (!en.MoveNext())
{
}
}
- public static string Concat(string str0, string str1)
+ public static string Concat(string? str0, string? str1)
{
if (IsNullOrEmpty(str0))
{
return result;
}
- public static string Concat(string str0, string str1, string str2)
+ public static string Concat(string? str0, string? str1, string? str2)
{
if (IsNullOrEmpty(str0))
{
return result;
}
- public static string Concat(string str0, string str1, string str2, string str3)
+ public static string Concat(string? str0, string? str1, string? str2, string? str3)
{
if (IsNullOrEmpty(str0))
{
return result;
}
- public static string Concat(params string[] values)
+ public static string Concat(params string?[] values)
{
if (values == null)
throw new ArgumentNullException(nameof(values));
long totalLengthLong = 0;
for (int i = 0; i < values.Length; i++)
{
- string value = values[i];
+ string? value = values[i];
if (value != null)
{
totalLengthLong += value.Length;
int copiedLength = 0;
for (int i = 0; i < values.Length; i++)
{
- string value = values[i];
+ string? value = values[i];
if (!string.IsNullOrEmpty(value))
{
int valueLen = value.Length;
// something changed concurrently to mutate the input array: fall back to
// doing the concatenation again, but this time with a defensive copy. This
// fall back should be extremely rare.
- return copiedLength == totalLength ? result : Concat((string[])values.Clone());
+ return copiedLength == totalLength ? result : Concat((string?[])values.Clone());
}
- public static string Format(string format, object arg0)
+ public static string Format(string format, object? arg0)
{
return FormatHelper(null, format, new ParamsArray(arg0));
}
- public static string Format(string format, object arg0, object arg1)
+ public static string Format(string format, object? arg0, object? arg1)
{
return FormatHelper(null, format, new ParamsArray(arg0, arg1));
}
- public static string Format(string format, object arg0, object arg1, object arg2)
+ public static string Format(string format, object? arg0, object? arg1, object? arg2)
{
return FormatHelper(null, format, new ParamsArray(arg0, arg1, arg2));
}
- public static string Format(string format, params object[] args)
+ public static string Format(string format, params object?[] args)
{
if (args == null)
{
return FormatHelper(null, format, new ParamsArray(args));
}
- public static string Format(IFormatProvider provider, string format, object arg0)
+ public static string Format(IFormatProvider? provider, string format, object? arg0)
{
return FormatHelper(provider, format, new ParamsArray(arg0));
}
- public static string Format(IFormatProvider provider, string format, object arg0, object arg1)
+ public static string Format(IFormatProvider? provider, string format, object? arg0, object? arg1)
{
return FormatHelper(provider, format, new ParamsArray(arg0, arg1));
}
- public static string Format(IFormatProvider provider, string format, object arg0, object arg1, object arg2)
+ public static string Format(IFormatProvider? provider, string format, object? arg0, object? arg1, object? arg2)
{
return FormatHelper(provider, format, new ParamsArray(arg0, arg1, arg2));
}
- public static string Format(IFormatProvider provider, string format, params object[] args)
+ public static string Format(IFormatProvider? provider, string format, params object?[] args)
{
if (args == null)
{
return FormatHelper(provider, format, new ParamsArray(args));
}
- private static string FormatHelper(IFormatProvider provider, string format, ParamsArray args)
+ private static string FormatHelper(IFormatProvider? provider, string format, ParamsArray args)
{
if (format == null)
throw new ArgumentNullException(nameof(format));
return result;
}
- public static string Join(char separator, params string[] value)
+ public static string Join(char separator, params string?[] value)
{
if (value == null)
{
return Join(separator, value, 0, value.Length);
}
- public static unsafe string Join(char separator, params object[] values)
+ public static unsafe string Join(char separator, params object?[] values)
{
// Defer argument validation to the internal function
return JoinCore(&separator, 1, values);
return JoinCore(&separator, 1, values);
}
- public static unsafe string Join(char separator, string[] value, int startIndex, int count)
+ public static unsafe string Join(char separator, string?[] value, int startIndex, int count)
{
// Defer argument validation to the internal function
return JoinCore(&separator, 1, value, startIndex, count);
// Joins an array of strings together as one string with a separator between each original string.
//
- public static string Join(string separator, params string[] value)
+ public static string Join(string? separator, params string?[] value)
{
if (value == null)
{
return Join(separator, value, 0, value.Length);
}
- public static unsafe string Join(string separator, params object[] values)
+ public static unsafe string Join(string? separator, params object?[] values)
{
separator = separator ?? string.Empty;
fixed (char* pSeparator = &separator._firstChar)
}
}
- public static unsafe string Join<T>(string separator, IEnumerable<T> values)
+ public static unsafe string Join<T>(string? separator, IEnumerable<T> values)
{
separator = separator ?? string.Empty;
fixed (char* pSeparator = &separator._firstChar)
}
}
- public static string Join(string separator, IEnumerable<string> values)
+ public static string Join(string? separator, IEnumerable<string> values)
{
if (values == null)
{
// Joins an array of strings together as one string with a separator between each original string.
//
- public static unsafe string Join(string separator, string[] value, int startIndex, int count)
+ public static unsafe string Join(string? separator, string?[] value, int startIndex, int count)
{
separator = separator ?? string.Empty;
fixed (char* pSeparator = &separator._firstChar)
}
}
- private static unsafe string JoinCore(char* separator, int separatorLength, object[] values)
+ private static unsafe string JoinCore(char* separator, int separatorLength, object?[] values)
{
if (values == null)
{
return string.Empty;
}
- string firstString = values[0]?.ToString();
+ string? firstString = values[0]?.ToString();
if (values.Length == 1)
{
for (int i = 1; i < values.Length; i++)
{
result.Append(separator, separatorLength);
- object value = values[i];
+ object? value = values[i];
if (value != null)
{
result.Append(value.ToString());
// Everything should be called in the order
// MoveNext-Current-ToString, unless further optimizations
// can be made, to avoid breaking changes
- string firstString = currentValue?.ToString();
+ string? firstString = currentValue?.ToString();
// If there's only 1 item, simply call ToString on that
if (!en.MoveNext())
}
}
- private static unsafe string JoinCore(char* separator, int separatorLength, string[] value, int startIndex, int count)
+ private static unsafe string JoinCore(char* separator, int separatorLength, string?[] value, int startIndex, int count)
{
// If the separator is null, it is converted to an empty string before entering this function.
// Even for empty strings, fixed should never return null (it should return a pointer to a null char).
// Calculate the length of the resultant string so we know how much space to allocate.
for (int i = startIndex, end = startIndex + count; i < end; i++)
{
- string currentValue = value[i];
+ string? currentValue = value[i];
if (currentValue != null)
{
totalLength += currentValue.Length;
// We range check again to avoid buffer overflows if this happens.
- string currentValue = value[i];
+ string? currentValue = value[i];
if (currentValue != null)
{
int valueLen = currentValue.Length;
// fall back should be extremely rare.
return copiedLength == totalLength ?
result :
- JoinCore(separator, separatorLength, (string[])value.Clone(), startIndex, count);
+ JoinCore(separator, separatorLength, (string?[])value.Clone(), startIndex, count);
}
public string PadLeft(int totalWidth) => PadLeft(totalWidth, ' ');
return Substring(0, startIndex);
}
- public string Replace(string oldValue, string newValue, bool ignoreCase, CultureInfo culture)
+ public string Replace(string oldValue, string? newValue, bool ignoreCase, CultureInfo? culture)
{
return ReplaceCore(oldValue, newValue, culture, ignoreCase ? CompareOptions.IgnoreCase : CompareOptions.None);
}
- public string Replace(string oldValue, string newValue, StringComparison comparisonType)
+ public string Replace(string oldValue, string? newValue, StringComparison comparisonType)
{
switch (comparisonType)
{
}
}
- private unsafe string ReplaceCore(string oldValue, string newValue, CultureInfo culture, CompareOptions options)
+ private unsafe string ReplaceCore(string oldValue, string? newValue, CultureInfo? culture, CompareOptions options)
{
if (oldValue == null)
throw new ArgumentNullException(nameof(oldValue));
}
}
- public string Replace(string oldValue, string newValue)
+ public string Replace(string oldValue, string? newValue)
{
if (oldValue == null)
throw new ArgumentNullException(nameof(oldValue));
// If the separator is null
// whitespace (i.e., Character.IsWhitespace) is used as the separator.
//
- public string[] Split(params char[] separator)
+ public string[] Split(params char[]? separator)
{
return SplitInternal(separator, int.MaxValue, StringSplitOptions.None);
}
// If there are more than count different strings, the last n-(count-1)
// elements are concatenated and added as the last string.
//
- public string[] Split(char[] separator, int count)
+ public string[] Split(char[]? separator, int count)
{
return SplitInternal(separator, count, StringSplitOptions.None);
}
- public string[] Split(char[] separator, StringSplitOptions options)
+ public string[] Split(char[]? separator, StringSplitOptions options)
{
return SplitInternal(separator, int.MaxValue, options);
}
- public string[] Split(char[] separator, int count, StringSplitOptions options)
+ public string[] Split(char[]? separator, int count, StringSplitOptions options)
{
return SplitInternal(separator, count, options);
}
return result;
}
- public string[] Split(string separator, StringSplitOptions options = StringSplitOptions.None)
+ public string[] Split(string? separator, StringSplitOptions options = StringSplitOptions.None)
{
return SplitInternal(separator ?? string.Empty, null, int.MaxValue, options);
}
- public string[] Split(string separator, int count, StringSplitOptions options = StringSplitOptions.None)
+ public string[] Split(string? separator, int count, StringSplitOptions options = StringSplitOptions.None)
{
return SplitInternal(separator ?? string.Empty, null, count, options);
}
- public string[] Split(string[] separator, StringSplitOptions options)
+ public string[] Split(string[]? separator, StringSplitOptions options)
{
return SplitInternal(null, separator, int.MaxValue, options);
}
- public string[] Split(string[] separator, int count, StringSplitOptions options)
+ public string[] Split(string[]? separator, int count, StringSplitOptions options)
{
return SplitInternal(null, separator, count, options);
}
- private string[] SplitInternal(string separator, string[] separators, int count, StringSplitOptions options)
+ private string[] SplitInternal(string? separator, string?[]? separators, int count, StringSplitOptions options)
{
if (count < 0)
{
if (!singleSeparator && (separators == null || separators.Length == 0))
{
- return SplitInternal((char[])null, count, options);
+ return SplitInternal(default(ReadOnlySpan<char>), count, options);
}
if ((count == 0) || (omitEmptyEntries && Length == 0))
return Array.Empty<string>();
}
- if (count == 1 || (singleSeparator && separator.Length == 0))
+ if (count == 1 || (singleSeparator && separator!.Length == 0))
{
return new string[] { this };
}
if (singleSeparator)
{
- return SplitInternal(separator, count, options);
+ return SplitInternal(separator!, count, options);
}
Span<int> sepListInitialSpan = stackalloc int[StackallocIntBufferSizeLimit];
Span<int> lengthListInitialSpan = stackalloc int[StackallocIntBufferSizeLimit];
var lengthListBuilder = new ValueListBuilder<int>(lengthListInitialSpan);
- MakeSeparatorList(separators, ref sepListBuilder, ref lengthListBuilder);
+ MakeSeparatorList(separators!, ref sepListBuilder, ref lengthListBuilder);
ReadOnlySpan<int> sepList = sepListBuilder.AsSpan();
ReadOnlySpan<int> lengthList = lengthListBuilder.AsSpan();
/// <param name="separators">separator strngs</param>
/// <param name="sepListBuilder"><see cref="ValueListBuilder{T}"/> for separator indexes</param>
/// <param name="lengthListBuilder"><see cref="ValueListBuilder{T}"/> for separator length values</param>
- private void MakeSeparatorList(string[] separators, ref ValueListBuilder<int> sepListBuilder, ref ValueListBuilder<int> lengthListBuilder)
+ private void MakeSeparatorList(string?[] separators, ref ValueListBuilder<int> sepListBuilder, ref ValueListBuilder<int> lengthListBuilder)
{
Debug.Assert(separators != null && separators.Length > 0, "separators != null && separators.Length > 0");
{
for (int j = 0; j < separators.Length; j++)
{
- string separator = separators[j];
+ string? separator = separators[j];
if (IsNullOrEmpty(separator))
{
continue;
public unsafe string Trim(char trimChar) => TrimHelper(&trimChar, 1, TrimType.Both);
// Removes a set of characters from the beginning and end of this string.
- public unsafe string Trim(params char[] trimChars)
+ public unsafe string Trim(params char[]? trimChars)
{
if (trimChars == null || trimChars.Length == 0)
{
public unsafe string TrimStart(char trimChar) => TrimHelper(&trimChar, 1, TrimType.Head);
// Removes a set of characters from the beginning of this string.
- public unsafe string TrimStart(params char[] trimChars)
+ public unsafe string TrimStart(params char[]? trimChars)
{
if (trimChars == null || trimChars.Length == 0)
{
public unsafe string TrimEnd(char trimChar) => TrimHelper(&trimChar, 1, TrimType.Tail);
// Removes a set of characters from the end of this string.
- public unsafe string TrimEnd(params char[] trimChars)
+ public unsafe string TrimEnd(params char[]? trimChars)
{
if (trimChars == null || trimChars.Length == 0)
{
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
+#nullable enable
using System.Buffers;
using System.Collections;
using System.Collections.Generic;
[Serializable]
[System.Runtime.CompilerServices.TypeForwardedFrom("mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")]
- public sealed partial class String : IComparable, IEnumerable, IConvertible, IEnumerable<char>, IComparable<string>, IEquatable<string>, ICloneable
+ public sealed partial class String : IComparable, IEnumerable, IConvertible, IEnumerable<char>, IComparable<string?>, IEquatable<string?>, ICloneable
{
/*
* CONSTRUCTORS
#if !CORECLR
static
#endif
- private string Ctor(char[] value)
+ private string Ctor(char[]? value)
{
if (value == null || value.Length == 0)
return Empty;
#if !CORECLR
static
#endif
- private unsafe string Ctor(sbyte* value, int startIndex, int length, Encoding enc)
+ private unsafe string Ctor(sbyte* value, int startIndex, int length, Encoding? enc)
{
if (enc == null)
return new string(value, startIndex, length);
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
- public static implicit operator ReadOnlySpan<char>(string value) =>
+ public static implicit operator ReadOnlySpan<char>(string? value) =>
value != null ? new ReadOnlySpan<char>(ref value.GetRawStringData(), value.Length) : default;
public object Clone()
}
[NonVersionable]
- public static bool IsNullOrEmpty(string value)
+ public static bool IsNullOrEmpty(string? value)
{
// Using 0u >= (uint)value.Length rather than
// value.Length == 0 as it will elide the bounds check to
[System.Runtime.CompilerServices.IndexerName("Chars")]
public string this[Range range] => Substring(range);
- public static bool IsNullOrWhiteSpace(string value)
+ public static bool IsNullOrWhiteSpace(string? value)
{
if (value == null) return true;
}
// Returns this string.
- public string ToString(IFormatProvider provider)
+ public string ToString(IFormatProvider? provider)
{
return this;
}
return TypeCode.String;
}
- bool IConvertible.ToBoolean(IFormatProvider provider)
+ bool IConvertible.ToBoolean(IFormatProvider? provider)
{
return Convert.ToBoolean(this, provider);
}
- char IConvertible.ToChar(IFormatProvider provider)
+ char IConvertible.ToChar(IFormatProvider? provider)
{
return Convert.ToChar(this, provider);
}
- sbyte IConvertible.ToSByte(IFormatProvider provider)
+ sbyte IConvertible.ToSByte(IFormatProvider? provider)
{
return Convert.ToSByte(this, provider);
}
- byte IConvertible.ToByte(IFormatProvider provider)
+ byte IConvertible.ToByte(IFormatProvider? provider)
{
return Convert.ToByte(this, provider);
}
- short IConvertible.ToInt16(IFormatProvider provider)
+ short IConvertible.ToInt16(IFormatProvider? provider)
{
return Convert.ToInt16(this, provider);
}
- ushort IConvertible.ToUInt16(IFormatProvider provider)
+ ushort IConvertible.ToUInt16(IFormatProvider? provider)
{
return Convert.ToUInt16(this, provider);
}
- int IConvertible.ToInt32(IFormatProvider provider)
+ int IConvertible.ToInt32(IFormatProvider? provider)
{
return Convert.ToInt32(this, provider);
}
- uint IConvertible.ToUInt32(IFormatProvider provider)
+ uint IConvertible.ToUInt32(IFormatProvider? provider)
{
return Convert.ToUInt32(this, provider);
}
- long IConvertible.ToInt64(IFormatProvider provider)
+ long IConvertible.ToInt64(IFormatProvider? provider)
{
return Convert.ToInt64(this, provider);
}
- ulong IConvertible.ToUInt64(IFormatProvider provider)
+ ulong IConvertible.ToUInt64(IFormatProvider? provider)
{
return Convert.ToUInt64(this, provider);
}
- float IConvertible.ToSingle(IFormatProvider provider)
+ float IConvertible.ToSingle(IFormatProvider? provider)
{
return Convert.ToSingle(this, provider);
}
- double IConvertible.ToDouble(IFormatProvider provider)
+ double IConvertible.ToDouble(IFormatProvider? provider)
{
return Convert.ToDouble(this, provider);
}
- decimal IConvertible.ToDecimal(IFormatProvider provider)
+ decimal IConvertible.ToDecimal(IFormatProvider? provider)
{
return Convert.ToDecimal(this, provider);
}
- DateTime IConvertible.ToDateTime(IFormatProvider provider)
+ DateTime IConvertible.ToDateTime(IFormatProvider? provider)
{
return Convert.ToDateTime(this, provider);
}
- object IConvertible.ToType(Type type, IFormatProvider provider)
+ object IConvertible.ToType(Type type, IFormatProvider? provider)
{
return Convert.DefaultToType((IConvertible)this, type, provider);
}