From b1ed827bfa9299412b7a8c8c7a7d9678b75586c3 Mon Sep 17 00:00:00 2001 From: Genevieve Warren <24882762+gewarren@users.noreply.github.com> Date: Fri, 29 May 2026 10:50:18 -0700 Subject: [PATCH 1/2] Clarify ToString return value when input is null --- xml/System/Convert.xml | 113 +++++++++++++++-------------------------- 1 file changed, 40 insertions(+), 73 deletions(-) diff --git a/xml/System/Convert.xml b/xml/System/Convert.xml index 4936f1621f7..82a29a722b4 100644 --- a/xml/System/Convert.xml +++ b/xml/System/Convert.xml @@ -16041,9 +16041,8 @@ . It returns for `true` values and for `false` values. - +This implementation is identical to . It returns for `true` values and for `false` values. ## Examples The following example illustrates the conversion of a to a , using `ToString`. It also illustrates that the string returned by the conversion equals either or . @@ -16110,9 +16109,8 @@ . - +This implementation is identical to . ## Examples The following example converts each value in a array to a string. @@ -16179,9 +16177,8 @@ . - +This implementation is identical to . ## Examples The following example converts a to a . @@ -16247,9 +16244,8 @@ . It uses the formatting conventions of the current culture and the "G" format specifier to convert a value to its string representation. - +This implementation is identical to . It uses the formatting conventions of the current culture and the "G" format specifier to convert a value to its string representation. ## Examples The following example converts each element in an array of a value to a value. @@ -16315,9 +16311,8 @@ . - +This implementation is identical to . ## Examples The following example converts a to a . @@ -16383,9 +16378,8 @@ . - +This implementation is identical to . ## Examples The following example converts a to a . @@ -16451,9 +16445,8 @@ . - +This implementation is identical to . ## Examples The following example converts each element in an array of 16-bit integers to its equivalent string representation. @@ -16519,7 +16512,8 @@ . It formats `value` by using the formatting conventions of the current culture. + +This implementation is identical to . It formats `value` by using the formatting conventions of the current culture. ## Examples The following example compares the method with the method. It defines a custom object that uses the sting "minus" to represent the negative sign. It converts each element in an integer array to its equivalent string representation using default formatting (the formatting conventions of the current culture) and the custom format provider. @@ -16585,9 +16579,8 @@ . - +This implementation is identical to . ## Examples The following example converts each element in a long integer array to its equivalent string representation. @@ -16647,16 +16640,15 @@ - An object that supplies the value to convert, or . + An object that supplies the value to convert. Converts the value of the specified object to its equivalent string representation. - The string representation of , or if is . + The string representation of , or if is an object whose value is . implementation of `value`. If `value` does not implement the interface, the method tries to call the implementation of `value`. If value does not implement the interface, the method calls the `ToString` method of the underlying type of `value`. - +To convert `value` to its string representation, the method tries to call the implementation of `value`. If `value` does not implement the interface, the method tries to call the implementation of `value`. If value does not implement the interface, the method calls the `ToString` method of the underlying type of `value`. ## Examples The following example converts each element in an object array to its equivalent string representation. @@ -16728,9 +16720,8 @@ . - +This implementation is identical to . ## Examples The following example converts each element in a signed byte array to its equivalent string representation. @@ -16796,9 +16787,8 @@ . - +This implementation is identical to . ## Examples The following example converts each element in an array of values to its equivalent string representation. @@ -16938,9 +16928,8 @@ . - +This implementation is identical to . ## Examples The following example converts each element in an array of unsigned 16-bit integer values to its equivalent string representation. @@ -17012,9 +17001,8 @@ . - +This implementation is identical to . ## Examples The following example converts each element in an unsigned integer array to its equivalent string representation. @@ -17086,9 +17074,8 @@ . - +This implementation is identical to . ## Examples The following example converts each element in an unsigned long integer array to its equivalent string representation. @@ -17164,9 +17151,8 @@ . It returns for `true` values and for `false` values. - +This implementation is identical to . It returns for `true` values and for `false` values. ## Examples The following example converts a value to a with the `ToString` method, using an object that displays the type of the format provider for which it is called. The example shows that the object is not referenced. @@ -17242,9 +17228,8 @@ . - +This implementation is identical to . ## Examples The following example converts each element in an unsigned byte array to its equivalent string representation using the formatting conventions of the en-US and fr-FR cultures. Because the "G" specifier by default outputs only decimal digits in a byte value's string representation, the `provider` parameter does not affect the formatting of the returned string. @@ -17314,8 +17299,6 @@ ## Remarks If `toBase` does not equal 10, the string that is returned by the method represents `value` by its magnitude only. If the method is called to create a string that will later be converted back to a number, a corresponding method that assumes a magnitude-only numeric representation should be called to perform the conversion. Such methods include or . - - ## Examples The following example converts each element in a byte array to its equivalent binary, hexadecimal, decimal, and hexadecimal string representations. @@ -17393,9 +17376,8 @@ . The `provider` parameter is ignored. - +This implementation is identical to . The `provider` parameter is ignored. ## Examples The following example converts a value to a with the `ToString` method, using an object that displays the type of the format provider for which it is called. The example shows that the object is not referenced. @@ -17471,9 +17453,8 @@ . - +This implementation is identical to . ## Examples The following example converts a value to its equivalent string representation in eight different cultures. @@ -17549,9 +17530,8 @@ . - +This implementation is identical to . ## Examples The following example converts each element in an array of values to its equivalent string representation in four different cultures. @@ -17627,9 +17607,8 @@ - +This implementation is identical to ## Examples The following example converts each element in an array of values to its equivalent string representation in four different cultures. @@ -17705,9 +17684,8 @@ . - +This implementation is identical to . ## Examples The following example defines a custom class that defines its negative sign as the string "~" and its positive sign as the string "!". It then calls the method to convert each element in an array of 16-bit integers to its equivalent string representation. The conversion uses the invariant culture as well as the custom object. @@ -17775,9 +17753,8 @@ method is called to create a string that will later be converted back to a number, a corresponding method that assumes a similar numeric representation should be called to perform the conversion. Such methods include and . - +If `value` is positive and `toBase` is 2, 8, or 16, the returned string uses sign-and-magnitude representation. If `value` is negative and `toBase` is 2, 8, or 16, the returned string uses two's complement representation. This means that the high-order bit of the high-order byte (bit 15) is interpreted as the sign bit. If the method is called to create a string that will later be converted back to a number, a corresponding method that assumes a similar numeric representation should be called to perform the conversion. Such methods include and . ## Examples The following example converts each element in an array of 16-bit signed integers to its equivalent binary, octal, decimal, and hexadecimal string representations. @@ -17856,9 +17833,8 @@ . - +This implementation is identical to . ## Examples The following example defines a custom class that defines its negative sign as the string "~" and its positive sign as the string "!". It then calls the method to convert each element in an array of integers to its equivalent string representation. The conversion uses the invariant culture as well as the custom object. @@ -17926,9 +17902,8 @@ method is called to create a string that will later be converted back to a number, a corresponding method that assumes a similar numeric representation should be called to perform the conversion. Such methods include and . - +If `value` is positive and `toBase` is 2, 8, or 16, the returned string uses sign-and-magnitude representation. If `value` is negative and `toBase` is 2, 8, or 16, the returned string uses two's complement representation. This means that the high-order bit of the highest-order byte (bit 31) is interpreted as the sign bit. If the method is called to create a string that will later be converted back to a number, a corresponding method that assumes a similar numeric representation should be called to perform the conversion. Such methods include and . ## Examples The following example converts each element in an integer array to its string representation in binary, octal, decimal, and hexadecimal. @@ -18007,9 +17982,8 @@ . - +This implementation is identical to . ## Examples The following example defines a custom class that defines its negative sign as the string "~" and its positive sign as the string "!". It then calls the method to convert each element in a long integer array to its equivalent string representation. The conversion uses the invariant culture as well as the custom object. @@ -18077,9 +18051,8 @@ method is called to create a string that will later be converted back to a number, a corresponding method that assumes a similar numeric representation should be called to perform the conversion. Such methods include and . - +If `value` is positive and `toBase` is not 10, the returned string uses sign-and-magnitude representation. If `value` is negative and `toBase` is not 10, the returned string uses two's complement representation. This means that the high-order bit of the highest-order byte (bit 63) is interpreted as the sign bit. If the method is called to create a string that will later be converted back to a number, a corresponding method that assumes a similar numeric representation should be called to perform the conversion. Such methods include and . ## Examples The following example converts each element in a long integer array to its equivalent binary, hexadecimal, decimal, and hexadecimal string representations. @@ -18143,19 +18116,18 @@ - An object that supplies the value to convert, or . - An object that supplies culture-specific formatting information. + An object that supplies the value to convert. + The culture-specific formatting information. Converts the value of the specified object to its equivalent string representation using the specified culture-specific formatting information. - The string representation of , or if is an object whose value is . If is , the method returns . + The string representation of , or if is an object whose value is . interface, the method calls the implementation of `value`. Otherwise, if the `value` parameter implements the interface, the method calls its implementation. If `value` implements neither interface, the method calls the `value` parameter's `ToString()` method, and the `provider` parameter is ignored. - - The `provider` parameter is used if the `value` parameter implements the or interface. The most common use of the `provider` parameter is to specify culture-specific information used in the conversion of `value`. For example, if the `value` parameter is a negative decimal number, the `provider` parameter can supply culture-specific information about the notation used for the negative sign and decimal separator. The second example in the next section illustrates a format provider that does not supply culture-sensitive formatting information. +If the `value` parameter implements the interface, the method calls the implementation of `value`. Otherwise, if the `value` parameter implements the interface, the method calls its implementation. If `value` implements neither interface, the method calls the `value` parameter's `ToString()` method, and the `provider` parameter is ignored. +The `provider` parameter is used if the `value` parameter implements the or interface. The most common use of the `provider` parameter is to specify culture-specific information used in the conversion of `value`. For example, if the `value` parameter is a negative decimal number, the `provider` parameter can supply culture-specific information about the notation used for the negative sign and decimal separator. The second example in the next section illustrates a format provider that does not supply culture-sensitive formatting information. ## Examples The following example defines a `Temperature` class that overrides the method but does not implement the interface. The example illustrates how calls to the method, in turn, call the `Temperature.ToString` method. @@ -18243,9 +18215,8 @@ . - +This implementation is identical to . ## Examples The following example defines a custom class that defines its negative sign as the string "~" and its positive sign as the string "!". It then calls the method to convert each element in signed byte array to its equivalent string representation. The conversion uses the invariant culture as well as the custom object. @@ -18321,9 +18292,8 @@ . - +This implementation is identical to . ## Examples The following example converts each element in an array of values to its equivalent string representation in four different cultures. @@ -18475,9 +18445,8 @@ . - +This implementation is identical to . ## Examples The following example defines a custom class that defines its negative sign as the string "~" and its positive sign as the string "!". It then calls the method to convert a 16-bit unsigned integer value to its equivalent string representation. The conversion uses both the invariant culture and the custom object. The output indicates that this formatting information is not used, because by default the "G" format specifier does not include a positive sign with positive values. @@ -18559,9 +18528,8 @@ . - +This implementation is identical to . ## Examples The following example defines a custom class that defines its negative sign as the string "~" and its positive sign as the string "!". It then calls the method to convert an unsigned integer value to its equivalent string representation. The conversion uses both the invariant culture and the custom object. The output indicates that this formatting information is not used, because by default the "G" format specifier does not include a positive sign with positive values. @@ -18643,9 +18611,8 @@ . - +This implementation is identical to . ## Examples The following example defines a custom class that defines its negative sign as the string "~" and its positive sign as the string "!". It then calls the method to convert an unsigned long integer value to its equivalent string representation. The conversion uses both the invariant culture and the custom object. The output indicates that this formatting information is not used, because by default the "G" format specifier does not include a positive sign with positive values. From b6843cd0c0d705797f4abd4870a3ebe092f23130 Mon Sep 17 00:00:00 2001 From: Genevieve Warren <24882762+gewarren@users.noreply.github.com> Date: Fri, 29 May 2026 11:10:09 -0700 Subject: [PATCH 2/2] Add period Removed duplicate sentence in Remarks section. --- xml/System/Convert.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xml/System/Convert.xml b/xml/System/Convert.xml index 82a29a722b4..a40ed5b1c35 100644 --- a/xml/System/Convert.xml +++ b/xml/System/Convert.xml @@ -17608,7 +17608,7 @@ This implementation is identical to +This implementation is identical to . ## Examples The following example converts each element in an array of values to its equivalent string representation in four different cultures.