Skip to content

Commit 2d8042b

Browse files
committed
Improve return value descriptions of String.Join
1 parent 5905bb6 commit 2d8042b

File tree

1 file changed

+33
-13
lines changed

1 file changed

+33
-13
lines changed

xml/System/String.xml

Lines changed: 33 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8373,7 +8373,7 @@ A string is empty if it is explicitly assigned an empty string ("") or <xref:Sy
83738373

83748374
-or-
83758375

8376-
<see cref="F:System.String.Empty" /> if <paramref name="values" /> has zero elements or all the elements of <paramref name="values" /> are <see langword="null" />.</returns>
8376+
<see cref="F:System.String.Empty" /> if <paramref name="values" /> has zero elements.</returns>
83778377
<remarks>To be added.</remarks>
83788378
<exception cref="T:System.ArgumentNullException">
83798379
<paramref name="value" /> is <see langword="null" />.</exception>
@@ -8424,7 +8424,7 @@ A string is empty if it is explicitly assigned an empty string ("") or <xref:Sy
84248424

84258425
-or-
84268426

8427-
<see cref="F:System.String.Empty" /> if <paramref name="value" /> has zero elements or all the elements of <paramref name="value" /> are <see langword="null" />.</returns>
8427+
<see cref="F:System.String.Empty" /> if <paramref name="value" /> has zero elements.</returns>
84288428
<remarks>To be added.</remarks>
84298429
<exception cref="T:System.ArgumentNullException">
84308430
<paramref name="value" /> is <see langword="null" />.</exception>
@@ -8478,11 +8478,11 @@ A string is empty if it is explicitly assigned an empty string ("") or <xref:Sy
84788478
<param name="separator">The string to use as a separator.<paramref name="separator" /> is included in the returned string only if <paramref name="values" /> has more than one element.</param>
84798479
<param name="values">A collection that contains the strings to concatenate.</param>
84808480
<summary>Concatenates the members of a constructed <see cref="T:System.Collections.Generic.IEnumerable`1" /> collection of type <see cref="T:System.String" />, using the specified separator between each member.</summary>
8481-
<returns>A string that consists of the members of <paramref name="values" /> delimited by the <paramref name="separator" /> string.
8481+
<returns>A string that consists of the elements of <paramref name="values" /> delimited by the <paramref name="separator" /> string.
84828482

84838483
-or-
84848484

8485-
<see cref="F:System.String.Empty" /> if <paramref name="values" /> has zero elements or all the elements of <paramref name="values" /> are <see langword="null" />.</returns>
8485+
<see cref="F:System.String.Empty" /> if <paramref name="values" /> has zero elements.</returns>
84868486
<remarks>
84878487
<format type="text/markdown"><![CDATA[
84888488

@@ -8562,7 +8562,15 @@ A string is empty if it is explicitly assigned an empty string ("") or <xref:Sy
85628562
<param name="separator">The string to use as a separator. <paramref name="separator" /> is included in the returned string only if <paramref name="values" /> has more than one element.</param>
85638563
<param name="values">An array that contains the elements to concatenate.</param>
85648564
<summary>Concatenates the elements of an object array, using the specified separator between each element.</summary>
8565-
<returns>A string that consists of the elements of <paramref name="values" /> delimited by the <paramref name="separator" /> string. If <paramref name="values" /> is an empty array, the method returns <see cref="F:System.String.Empty" />.</returns>
8565+
<returns>A string that consists of the elements of <paramref name="values" /> delimited by the <paramref name="separator" /> string.
8566+
8567+
-or-
8568+
8569+
<see cref="F:System.String.Empty" /> if <paramref name="values" /> has zero elements.
8570+
8571+
-or-
8572+
8573+
.NET Framework only: <see cref="F:System.String.Empty" /> if the first element of <paramref name="values" /> is <see langword="null" />.</returns>
85668574
<remarks>
85678575
<format type="text/markdown"><![CDATA[
85688576

@@ -8585,7 +8593,7 @@ A string is empty if it is explicitly assigned an empty string ("") or <xref:Sy
85858593
<paramref name="values" /> is <see langword="null" />.</exception>
85868594
<exception cref="T:System.OutOfMemoryException">The length of the resulting string overflows the maximum allowed length (<see cref="F:System.Int32.MaxValue" />).</exception>
85878595
<block subset="none" type="usage">
8588-
<para>If the first element of <paramref name="values" /> is <see langword="null" />, the <see cref="M:System.String.Join(System.String,System.Object[])" /> method does not concatenate the elements in <paramref name="values" /> but instead returns <see cref="F:System.String.Empty" />. A number of workarounds for this issue are available. The easiest is to assign a value of <see cref="F:System.String.Empty" /> to the first element of the array, as the following example shows.
8596+
<para>.NET Framework only: If the first element of <paramref name="values" /> is <see langword="null" />, the <see cref="M:System.String.Join(System.String,System.Object[])" /> method does not concatenate the elements in <paramref name="values" /> but instead returns <see cref="F:System.String.Empty" />. A number of workarounds for this issue are available. The easiest is to assign a value of <see cref="F:System.String.Empty" /> to the first element of the array, as the following example shows.
85898597

85908598
[!code-csharp-interactive[System.String.Join#6](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.string.join/cs/joinfix1.cs#6)]
85918599
[!code-vb[System.String.Join#6](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.string.join/vb/joinfix1.vb#6)]</para>
@@ -8646,7 +8654,11 @@ A string is empty if it is explicitly assigned an empty string ("") or <xref:Sy
86468654
<param name="separator">The string to use as a separator. <paramref name="separator" /> is included in the returned string only if <paramref name="value" /> has more than one element.</param>
86478655
<param name="value">An array that contains the elements to concatenate.</param>
86488656
<summary>Concatenates all the elements of a string array, using the specified separator between each element.</summary>
8649-
<returns>A string that consists of the elements in <paramref name="value" /> delimited by the <paramref name="separator" /> string. If <paramref name="value" /> is an empty array, the method returns <see cref="F:System.String.Empty" />.</returns>
8657+
<returns>A string that consists of the elements in <paramref name="value" /> delimited by the <paramref name="separator" /> string.
8658+
8659+
-or-
8660+
8661+
<see cref="F:System.String.Empty" /> if <paramref name="values" /> has zero elements.</returns>
86508662
<remarks>
86518663
<format type="text/markdown"><![CDATA[
86528664

@@ -8710,11 +8722,11 @@ A string is empty if it is explicitly assigned an empty string ("") or <xref:Sy
87108722
<param name="startIndex">The first item in <paramref name="value" /> to concatenate.</param>
87118723
<param name="count">The number of elements from <paramref name="value" /> to concatenate, starting with the element in the <paramref name="startIndex" /> position.</param>
87128724
<summary>Concatenates an array of strings, using the specified separator between each member, starting with the element in <paramref name="value" /> located at the <paramref name="startIndex" /> position, and concatenating up to <paramref name="count" /> elements.</summary>
8713-
<returns>A string that consists of the elements of <paramref name="value" /> delimited by the <paramref name="separator" /> character.
8725+
<returns>A string that consists of <paramref name="count" /> elements of <paramref name="value" /> starting at <paramref name="startIndex" /> delimited by the <paramref name="separator" /> character.
87148726

87158727
-or-
87168728

8717-
<see cref="F:System.String.Empty" /> if <paramref name="count" /> is zero, <paramref name="value" /> has no elements, or all the elements of <paramref name="value" /> are <see langword="null" /> or <see cref="F:System.String.Empty" />.</returns>
8729+
<see cref="F:System.String.Empty" /> if <paramref name="count" /> is zero.</returns>
87188730
<remarks>To be added.</remarks>
87198731
<exception cref="T:System.ArgumentNullException">
87208732
<paramref name="value" /> is <see langword="null" />.</exception>
@@ -8780,11 +8792,11 @@ A string is empty if it is explicitly assigned an empty string ("") or <xref:Sy
87808792
<param name="startIndex">The first element in <paramref name="value" /> to use.</param>
87818793
<param name="count">The number of elements of <paramref name="value" /> to use.</param>
87828794
<summary>Concatenates the specified elements of a string array, using the specified separator between each element.</summary>
8783-
<returns>A string that consists of the strings in <paramref name="value" /> delimited by the <paramref name="separator" /> string.
8795+
<returns>A string that consists of <paramref name="count" /> elements of <paramref name="value" /> starting at <paramref name="startIndex" /> delimited by the <paramref name="separator" /> character.
87848796

87858797
-or-
87868798

8787-
<see cref="F:System.String.Empty" /> if <paramref name="count" /> is zero, <paramref name="value" /> has no elements, or <paramref name="separator" /> and all the elements of <paramref name="value" /> are <see cref="F:System.String.Empty" />.</returns>
8799+
<see cref="F:System.String.Empty" /> if <paramref name="count" /> is zero.</returns>
87888800
<remarks>
87898801
<format type="text/markdown"><![CDATA[
87908802

@@ -8853,7 +8865,11 @@ A string is empty if it is explicitly assigned an empty string ("") or <xref:Sy
88538865
<param name="separator">The character to use as a separator. <paramref name="separator" /> is included in the returned string only if <paramref name="values" /> has more than one element.</param>
88548866
<param name="values">A collection that contains the objects to concatenate.</param>
88558867
<summary>Concatenates the members of a collection, using the specified separator between each member.</summary>
8856-
<returns>A string that consists of the members of <paramref name="values" /> delimited by the <paramref name="separator" /> character. If <paramref name="values" /> has no members, the method returns <see cref="F:System.String.Empty" />.</returns>
8868+
<returns>A string that consists of the members of <paramref name="values" /> delimited by the <paramref name="separator" /> character.
8869+
8870+
-or-
8871+
8872+
<see cref="F:System.String.Empty" /> if <paramref name="values" /> has no elements.</returns>
88578873
<remarks>To be added.</remarks>
88588874
<exception cref="T:System.ArgumentNullException">
88598875
<paramref name="values" /> is <see langword="null" />.</exception>
@@ -8911,7 +8927,11 @@ A string is empty if it is explicitly assigned an empty string ("") or <xref:Sy
89118927
<param name="separator">The string to use as a separator. <paramref name="separator" /> is included in the returned string only if <paramref name="values" /> has more than one element.</param>
89128928
<param name="values">A collection that contains the objects to concatenate.</param>
89138929
<summary>Concatenates the members of a collection, using the specified separator between each member.</summary>
8914-
<returns>A string that consists of the members of <paramref name="values" /> delimited by the <paramref name="separator" /> string. If <paramref name="values" /> has no members, the method returns <see cref="F:System.String.Empty" />.</returns>
8930+
<returns>A string that consists of the elements of <paramref name="values" /> delimited by the <paramref name="separator" /> string.
8931+
8932+
-or-
8933+
8934+
<see cref="F:System.String.Empty" /> if <paramref name="values" /> has no elements.</returns>
89158935
<remarks>
89168936
<format type="text/markdown"><![CDATA[
89178937

0 commit comments

Comments
 (0)