Skip to content

Commit 5e0cec7

Browse files
authored
Port System.Text new docs (#10159)
* System.Text
1 parent ae69a2f commit 5e0cec7

File tree

4 files changed

+118
-88
lines changed

4 files changed

+118
-88
lines changed

xml/System.Text/ASCIIEncoding.xml

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1848,11 +1848,12 @@
18481848
<Parameter Name="bytesWritten" Type="System.Int32" RefType="out" Index="2" FrameworkAlternate="net-8.0;net-9.0" />
18491849
</Parameters>
18501850
<Docs>
1851-
<param name="chars">To be added.</param>
1852-
<param name="bytes">To be added.</param>
1853-
<param name="bytesWritten">To be added.</param>
1854-
<summary>To be added.</summary>
1855-
<returns>To be added.</returns>
1851+
<param name="chars">The span containing the set of characters to encode.</param>
1852+
<param name="bytes">The byte span to hold the encoded bytes.</param>
1853+
<param name="bytesWritten">Upon successful completion of the operation, the number of bytes encoded into <paramref name="bytes" />.</param>
1854+
<summary>Encodes into a span of bytes a set of characters from the specified read-only span if the destination is large enough.</summary>
1855+
<returns>
1856+
<see langword="true" /> if all of the characters were encoded into the destination; <see langword="false" /> if the destination was too small to contain all the encoded bytes.</returns>
18561857
<remarks>To be added.</remarks>
18571858
<inheritdoc />
18581859
</Docs>
@@ -1885,11 +1886,12 @@
18851886
<Parameter Name="charsWritten" Type="System.Int32" RefType="out" Index="2" FrameworkAlternate="net-8.0;net-9.0" />
18861887
</Parameters>
18871888
<Docs>
1888-
<param name="bytes">To be added.</param>
1889-
<param name="chars">To be added.</param>
1890-
<param name="charsWritten">To be added.</param>
1891-
<summary>To be added.</summary>
1892-
<returns>To be added.</returns>
1889+
<param name="bytes">A read-only span containing the sequence of bytes to decode.</param>
1890+
<param name="chars">The character span receiving the decoded bytes.</param>
1891+
<param name="charsWritten">Upon successful completion of the operation, the number of chars decoded into <paramref name="chars" />.</param>
1892+
<summary>Decodes into a span of chars a set of bytes from the specified read-only span if the destination is large enough.</summary>
1893+
<returns>
1894+
<see langword="true" /> if all of the characters were decoded into the destination; <see langword="false" /> if the destination was too small to contain all the decoded chars.</returns>
18931895
<remarks>To be added.</remarks>
18941896
<inheritdoc />
18951897
</Docs>

xml/System.Text/Ascii.xml

Lines changed: 39 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,11 @@
6969
<Parameter Name="right" Type="System.ReadOnlySpan&lt;System.Char&gt;" />
7070
</Parameters>
7171
<Docs>
72-
<param name="left">To be added.</param>
73-
<param name="right">To be added.</param>
74-
<summary>To be added.</summary>
75-
<returns>To be added.</returns>
72+
<param name="left">The buffer to compare with <paramref name="right" />.</param>
73+
<param name="right">The buffer to compare with <paramref name="left" />.</param>
74+
<summary>Determines whether the provided buffers contain equal ASCII characters.</summary>
75+
<returns>
76+
<see langword="true" /> if the corresponding elements in <paramref name="left" /> and <paramref name="right" /> are equal and ASCII; <see langword="false" /> otherwise.</returns>
7677
<remarks>To be added.</remarks>
7778
<inheritdoc cref="M:System.Text.Ascii.Equals(System.ReadOnlySpan{System.Byte},System.ReadOnlySpan{System.Byte})" />
7879
</Docs>
@@ -98,10 +99,11 @@
9899
<Parameter Name="right" Type="System.ReadOnlySpan&lt;System.Byte&gt;" />
99100
</Parameters>
100101
<Docs>
101-
<param name="left">To be added.</param>
102-
<param name="right">To be added.</param>
103-
<summary>To be added.</summary>
104-
<returns>To be added.</returns>
102+
<param name="left">The buffer to compare with <paramref name="right" />.</param>
103+
<param name="right">The buffer to compare with <paramref name="left" />.</param>
104+
<summary>Determines whether the provided buffers contain equal ASCII characters.</summary>
105+
<returns>
106+
<see langword="true" /> if the corresponding elements in <paramref name="left" /> and <paramref name="right" /> are equal and ASCII; <see langword="false" /> otherwise.</returns>
105107
<remarks>To be added.</remarks>
106108
<inheritdoc cref="M:System.Text.Ascii.Equals(System.ReadOnlySpan{System.Byte},System.ReadOnlySpan{System.Char})" />
107109
</Docs>
@@ -127,10 +129,11 @@
127129
<Parameter Name="right" Type="System.ReadOnlySpan&lt;System.Char&gt;" />
128130
</Parameters>
129131
<Docs>
130-
<param name="left">To be added.</param>
131-
<param name="right">To be added.</param>
132-
<summary>To be added.</summary>
133-
<returns>To be added.</returns>
132+
<param name="left">The buffer to compare with <paramref name="right" />.</param>
133+
<param name="right">The buffer to compare with <paramref name="left" />.</param>
134+
<summary>Determines whether the provided buffers contain equal ASCII characters.</summary>
135+
<returns>
136+
<see langword="true" /> if the corresponding elements in <paramref name="left" /> and <paramref name="right" /> are equal and ASCII; <see langword="false" /> otherwise.</returns>
134137
<remarks>To be added.</remarks>
135138
<inheritdoc cref="M:System.Text.Ascii.Equals(System.ReadOnlySpan{System.Byte},System.ReadOnlySpan{System.Char})" />
136139
</Docs>
@@ -185,10 +188,11 @@
185188
<Parameter Name="right" Type="System.ReadOnlySpan&lt;System.Char&gt;" />
186189
</Parameters>
187190
<Docs>
188-
<param name="left">To be added.</param>
189-
<param name="right">To be added.</param>
190-
<summary>To be added.</summary>
191-
<returns>To be added.</returns>
191+
<param name="left">The buffer to compare with <paramref name="right" />.</param>
192+
<param name="right">The buffer to compare with <paramref name="left" />.</param>
193+
<summary>Determines whether the provided buffers contain equal ASCII characters, ignoring case considerations.</summary>
194+
<returns>
195+
<see langword="true" /> if the corresponding elements in <paramref name="left" /> and <paramref name="right" /> are equal ignoring case considerations and ASCII; <see langword="false" /> otherwise.</returns>
192196
<remarks>To be added.</remarks>
193197
<inheritdoc cref="M:System.Text.Ascii.EqualsIgnoreCase(System.ReadOnlySpan{System.Byte},System.ReadOnlySpan{System.Byte})" />
194198
</Docs>
@@ -214,10 +218,11 @@
214218
<Parameter Name="right" Type="System.ReadOnlySpan&lt;System.Byte&gt;" />
215219
</Parameters>
216220
<Docs>
217-
<param name="left">To be added.</param>
218-
<param name="right">To be added.</param>
219-
<summary>To be added.</summary>
220-
<returns>To be added.</returns>
221+
<param name="left">The buffer to compare with <paramref name="right" />.</param>
222+
<param name="right">The buffer to compare with <paramref name="left" />.</param>
223+
<summary>Determines whether the provided buffers contain equal ASCII characters, ignoring case considerations.</summary>
224+
<returns>
225+
<see langword="true" /> if the corresponding elements in <paramref name="left" /> and <paramref name="right" /> are equal ignoring case considerations and ASCII; <see langword="false" /> otherwise.</returns>
221226
<remarks>To be added.</remarks>
222227
<inheritdoc cref="M:System.Text.Ascii.EqualsIgnoreCase(System.ReadOnlySpan{System.Byte},System.ReadOnlySpan{System.Byte})" />
223228
</Docs>
@@ -243,10 +248,11 @@
243248
<Parameter Name="right" Type="System.ReadOnlySpan&lt;System.Char&gt;" />
244249
</Parameters>
245250
<Docs>
246-
<param name="left">To be added.</param>
247-
<param name="right">To be added.</param>
248-
<summary>To be added.</summary>
249-
<returns>To be added.</returns>
251+
<param name="left">The buffer to compare with <paramref name="right" />.</param>
252+
<param name="right">The buffer to compare with <paramref name="left" />.</param>
253+
<summary>Determines whether the provided buffers contain equal ASCII characters, ignoring case considerations.</summary>
254+
<returns>
255+
<see langword="true" /> if the corresponding elements in <paramref name="left" /> and <paramref name="right" /> are equal ignoring case considerations and ASCII; <see langword="false" /> otherwise.</returns>
250256
<remarks>To be added.</remarks>
251257
<inheritdoc cref="M:System.Text.Ascii.EqualsIgnoreCase(System.ReadOnlySpan{System.Byte},System.ReadOnlySpan{System.Byte})" />
252258
</Docs>
@@ -817,9 +823,9 @@
817823
<Parameter Name="value" Type="System.ReadOnlySpan&lt;System.Char&gt;" />
818824
</Parameters>
819825
<Docs>
820-
<param name="value">To be added.</param>
821-
<summary>To be added.</summary>
822-
<returns>To be added.</returns>
826+
<param name="value">The ASCII buffer.</param>
827+
<summary>Trims all leading and trailing ASCII whitespaces from the buffer.</summary>
828+
<returns>The range of the untrimmed data.</returns>
823829
<remarks>To be added.</remarks>
824830
<inheritdoc cref="M:System.Text.Ascii.Trim(System.ReadOnlySpan{System.Byte})" />
825831
</Docs>
@@ -870,9 +876,9 @@
870876
<Parameter Name="value" Type="System.ReadOnlySpan&lt;System.Char&gt;" />
871877
</Parameters>
872878
<Docs>
873-
<param name="value">To be added.</param>
874-
<summary>To be added.</summary>
875-
<returns>To be added.</returns>
879+
<param name="value">The ASCII buffer.</param>
880+
<summary>Trims all trailing ASCII whitespaces from the buffer.</summary>
881+
<returns>The range of the untrimmed data.</returns>
876882
<remarks>To be added.</remarks>
877883
<inheritdoc cref="M:System.Text.Ascii.TrimEnd(System.ReadOnlySpan{System.Byte})" />
878884
</Docs>
@@ -923,9 +929,9 @@
923929
<Parameter Name="value" Type="System.ReadOnlySpan&lt;System.Char&gt;" />
924930
</Parameters>
925931
<Docs>
926-
<param name="value">To be added.</param>
927-
<summary>To be added.</summary>
928-
<returns>To be added.</returns>
932+
<param name="value">The ASCII buffer.</param>
933+
<summary>Trims all leading ASCII whitespaces from the buffer.</summary>
934+
<returns>The range of the untrimmed data.</returns>
929935
<remarks>To be added.</remarks>
930936
<inheritdoc cref="M:System.Text.Ascii.TrimStart(System.ReadOnlySpan{System.Byte})" />
931937
</Docs>

xml/System.Text/StringBuilder.xml

Lines changed: 55 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -2690,11 +2690,21 @@ The following example shows how to call many of the methods defined by the <xref
26902690
</Parameter>
26912691
</Parameters>
26922692
<Docs>
2693-
<param name="format">To be added.</param>
2694-
<param name="args">To be added.</param>
2695-
<summary>To be added.</summary>
2696-
<returns>To be added.</returns>
2693+
<param name="format">A composite format string.</param>
2694+
<param name="args">A span of objects to format.</param>
2695+
<summary>Appends the string returned by processing a composite format string, which contains zero or more format items, to this instance.
2696+
Each format item is replaced by the string representation of a corresponding argument in a parameter span.</summary>
2697+
<returns>A reference to this instance after the append operation has completed.</returns>
26972698
<remarks>To be added.</remarks>
2699+
<exception cref="T:System.ArgumentNullException">
2700+
<paramref name="format" /> is <see langword="null" />.</exception>
2701+
<exception cref="T:System.ArgumentOutOfRangeException">The length of the expanded string would exceed <see cref="P:System.Text.StringBuilder.MaxCapacity" />.</exception>
2702+
<exception cref="T:System.FormatException">
2703+
<paramref name="format" /> is invalid.
2704+
2705+
-or-
2706+
2707+
The index of a format item is less than 0 (zero), or greater than or equal to the length of the <paramref name="args" /> span.</exception>
26982708
</Docs>
26992709
</Member>
27002710
<Member MemberName="AppendFormat">
@@ -3050,12 +3060,22 @@ The following example shows how to call many of the methods defined by the <xref
30503060
</Parameter>
30513061
</Parameters>
30523062
<Docs>
3053-
<param name="provider">To be added.</param>
3054-
<param name="format">To be added.</param>
3055-
<param name="args">To be added.</param>
3056-
<summary>To be added.</summary>
3057-
<returns>To be added.</returns>
3063+
<param name="provider">An object that supplies culture-specific formatting information.</param>
3064+
<param name="format">A composite format string.</param>
3065+
<param name="args">A span of objects to format.</param>
3066+
<summary>Appends the string returned by processing a composite format string, which contains zero or more format items, to this instance.
3067+
Each format item is replaced by the string representation of a corresponding argument in a parameter span using a specified format provider.</summary>
3068+
<returns>A reference to this instance after the append operation has completed.</returns>
30583069
<remarks>To be added.</remarks>
3070+
<exception cref="T:System.ArgumentNullException">
3071+
<paramref name="format" /> is <see langword="null" />.</exception>
3072+
<exception cref="T:System.ArgumentOutOfRangeException">The length of the expanded string would exceed <see cref="P:System.Text.StringBuilder.MaxCapacity" />.</exception>
3073+
<exception cref="T:System.FormatException">
3074+
<paramref name="format" /> is invalid.
3075+
3076+
-or-
3077+
3078+
The index of a format item is less than 0 (zero), or greater than or equal to the length of the <paramref name="args" /> span.</exception>
30593079
</Docs>
30603080
</Member>
30613081
<Member MemberName="AppendFormat">
@@ -4016,10 +4036,10 @@ The following example shows how to call many of the methods defined by the <xref
40164036
</Parameter>
40174037
</Parameters>
40184038
<Docs>
4019-
<param name="separator">To be added.</param>
4020-
<param name="values">To be added.</param>
4021-
<summary>To be added.</summary>
4022-
<returns>To be added.</returns>
4039+
<param name="separator">The character to use as a separator. <paramref name="separator" /> is included in the joined strings only if <paramref name="values" /> has more than one element.</param>
4040+
<param name="values">A span that contains the strings to concatenate and append to the current instance of the string builder.</param>
4041+
<summary>Concatenates the string representations of the elements in the provided span of objects, using the specified char separator between each member, then appends the result to the current instance of the string builder.</summary>
4042+
<returns>A reference to this instance after the append operation has completed.</returns>
40234043
<remarks>To be added.</remarks>
40244044
</Docs>
40254045
</Member>
@@ -4064,10 +4084,10 @@ The following example shows how to call many of the methods defined by the <xref
40644084
</Parameter>
40654085
</Parameters>
40664086
<Docs>
4067-
<param name="separator">To be added.</param>
4068-
<param name="values">To be added.</param>
4069-
<summary>To be added.</summary>
4070-
<returns>To be added.</returns>
4087+
<param name="separator">The character to use as a separator. <paramref name="separator" /> is included in the joined strings only if <paramref name="values" /> has more than one element.</param>
4088+
<param name="values">A span that contains the strings to concatenate and append to the current instance of the string builder.</param>
4089+
<summary>Concatenates the strings of the provided span, using the specified char separator between each string, then appends the result to the current instance of the string builder.</summary>
4090+
<returns>A reference to this instance after the append operation has completed.</returns>
40714091
<remarks>To be added.</remarks>
40724092
</Docs>
40734093
</Member>
@@ -4232,10 +4252,10 @@ The following example shows how to call many of the methods defined by the <xref
42324252
</Parameter>
42334253
</Parameters>
42344254
<Docs>
4235-
<param name="separator">To be added.</param>
4236-
<param name="values">To be added.</param>
4237-
<summary>To be added.</summary>
4238-
<returns>To be added.</returns>
4255+
<param name="separator">The string to use as a separator. <paramref name="separator" /> is included in the joined strings only if <paramref name="values" /> has more than one element.</param>
4256+
<param name="values">A span that contains the strings to concatenate and append to the current instance of the string builder.</param>
4257+
<summary>Concatenates the string representations of the elements in the provided span of objects, using the specified separator between each member, then appends the result to the current instance of the string builder.</summary>
4258+
<returns>A reference to this instance after the append operation has completed.</returns>
42394259
<remarks>To be added.</remarks>
42404260
</Docs>
42414261
</Member>
@@ -4287,10 +4307,10 @@ The following example shows how to call many of the methods defined by the <xref
42874307
</Parameter>
42884308
</Parameters>
42894309
<Docs>
4290-
<param name="separator">To be added.</param>
4291-
<param name="values">To be added.</param>
4292-
<summary>To be added.</summary>
4293-
<returns>To be added.</returns>
4310+
<param name="separator">The string to use as a separator. <paramref name="separator" /> is included in the joined strings only if <paramref name="values" /> has more than one element.</param>
4311+
<param name="values">A span that contains the strings to concatenate and append to the current instance of the string builder.</param>
4312+
<summary>Concatenates the strings of the provided span, using the specified separator between each string, then appends the result to the current instance of the string builder.</summary>
4313+
<returns>A reference to this instance after the append operation has completed.</returns>
42944314
<remarks>To be added.</remarks>
42954315
</Docs>
42964316
</Member>
@@ -7012,11 +7032,11 @@ In .NET Core and in the .NET Framework 4.0 and later versions, when you instanti
70127032
<Parameter Name="newValue" Type="System.ReadOnlySpan&lt;System.Char&gt;" Index="1" FrameworkAlternate="net-9.0" />
70137033
</Parameters>
70147034
<Docs>
7015-
<param name="oldValue">To be added.</param>
7016-
<param name="newValue">To be added.</param>
7017-
<summary>To be added.</summary>
7035+
<param name="oldValue">The read-only character span to replace.</param>
7036+
<param name="newValue">The read-only character span to replace <paramref name="oldValue" /> with.</param>
7037+
<summary>Replaces all instances of one read-only character span with another in this builder.</summary>
70187038
<returns>To be added.</returns>
7019-
<remarks>To be added.</remarks>
7039+
<remarks>If <paramref name="newValue" /> is empty, instances of <paramref name="oldValue" /> are removed from this builder.</remarks>
70207040
</Docs>
70217041
</Member>
70227042
<Member MemberName="Replace">
@@ -7208,13 +7228,13 @@ In .NET Core and in the .NET Framework 4.0 and later versions, when you instanti
72087228
<Parameter Name="count" Type="System.Int32" Index="3" FrameworkAlternate="net-9.0" />
72097229
</Parameters>
72107230
<Docs>
7211-
<param name="oldValue">To be added.</param>
7212-
<param name="newValue">To be added.</param>
7213-
<param name="startIndex">To be added.</param>
7214-
<param name="count">To be added.</param>
7215-
<summary>To be added.</summary>
7231+
<param name="oldValue">The read-only character span to replace.</param>
7232+
<param name="newValue">The read-only character span to replace <paramref name="oldValue" /> with.</param>
7233+
<param name="startIndex">The index to start in this builder.</param>
7234+
<param name="count">The number of characters to read in this builder.</param>
7235+
<summary>Replaces all instances of one read-only character span with another in part of this builder.</summary>
72167236
<returns>To be added.</returns>
7217-
<remarks>To be added.</remarks>
7237+
<remarks>If <paramref name="newValue" /> is empty, instances of <paramref name="oldValue" /> are removed from this builder.</remarks>
72187238
</Docs>
72197239
</Member>
72207240
<Member MemberName="Replace">

0 commit comments

Comments
 (0)