Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 36bd10c

Browse files
authored
remove dupe sentence + mig fix (dotnet#2241)
1 parent cfed84f commit 36bd10c

File tree

1 file changed

+8
-14
lines changed

1 file changed

+8
-14
lines changed

xml/System/String.xml

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@
112112
[!code-csharp-interactive[System.String.Class.Instantiate#4](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.string.class.instantiate/cs/program.cs#4)]
113113
[!code-vb[System.String.Class.Instantiate#4](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.string.class.instantiate/vb/instantiate1.vb#4)]
114114

115-
- By calling a formatting method to convert a value or object to its string representation. The following example uses the [composite formatting](~/docs/standard/base-types/composite-formatting.md) feature to embed the string representation of two objects into a string.
115+
- By calling a formatting method to convert a value or object to its string representation. The following example uses the [composite formatting](~/docs/standard/base-types/composite-formatting.md) feature to embed the string representation of two objects into a string.
116116

117117
[!code-cpp[System.String.Class.Instantiate#5](~/samples/snippets/cpp/VS_Snippets_CLR_System/system.string.class.instantiate/cpp/string.instantiate3.cpp#5)]
118118
[!code-csharp-interactive[System.String.Class.Instantiate#5](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.string.class.instantiate/cs/program.cs#5)]
@@ -6224,40 +6224,34 @@ This method uses the [composite formatting feature](~/docs/standard/base-types/c
62246224
>
62256225
> For more information about hash codes, see <xref:System.Object.GetHashCode%2A?displayProperty=nameWithType>.
62266226

6227-
In desktop apps, you can use the [\<UseRandomizedStringHashAlgorithm> element](~/docs/framework/configure-apps/file-schema/runtime/userandomizedstringhashalgorithm-element.md) to generate unique hash codes on a per application domain basis. This can reduce the number of collisions and improve the overall performance of insertions and lookups that use hash tables. The following example shows how to use the [\<UseRandomizedStringHashAlgorithm> element](~/docs/framework/configure-apps/file-schema/runtime/userandomizedstringhashalgorithm-element.md). It defines a to generate unique hash codes on a per application domain basis. This can reduce the number of collisions and improve the overall performance of insertions and lookups that use hash tables. The following example shows how to use the . It defines a `DisplayString` class that includes a private string constant, `s`, whose value is "This is a string." It also includes a `ShowStringHashCode` method that displays the string value and its hash code along with the name of the application domain in which the method is executing.
6227+
In desktop apps, you can use the [\<UseRandomizedStringHashAlgorithm> element](~/docs/framework/configure-apps/file-schema/runtime/userandomizedstringhashalgorithm-element.md) to generate unique hash codes on a per application domain basis. This can reduce the number of collisions and improve the overall performance of insertions and lookups that use hash tables. The following example shows how to use the [\<UseRandomizedStringHashAlgorithm> element](~/docs/framework/configure-apps/file-schema/runtime/userandomizedstringhashalgorithm-element.md). It defines a `DisplayString` class that includes a private string constant, `s`, whose value is "This is a string." It also includes a `ShowStringHashCode` method that displays the string value and its hash code along with the name of the application domain in which the method is executing.
62286228

62296229
[!code-csharp[System.String.GetHashCode#2](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.String.GetHashCode/CS/perdomain.cs#2)]
62306230
[!code-vb[System.String.GetHashCode#2](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.String.GetHashCode/VB/perdomain.vb#2)]
62316231

62326232
When you run the example without supplying a configuration file, it displays output similar to the following. Note that the hash codes for the string are identical in the two application domains.
62336233

6234-
```
6235-
6234+
```
62366235
String 'This is a string.' in domain 'PerDomain.exe': 941BCEAC
6237-
String 'This is a string.' in domain 'NewDomain': 941BCEAC
6238-
6236+
String 'This is a string.' in domain 'NewDomain': 941BCEAC
62396237
```
62406238

62416239
However, if you add the following configuration file to the example's directory and then run the example, the hash codes for the same string will differ by application domain.
62426240

6243-
```xml
6244-
6241+
```xml
62456242
<?xml version ="1.0"?>
62466243
<configuration>
62476244
<runtime>
62486245
<UseRandomizedStringHashAlgorithm enabled="1" />
62496246
</runtime>
6250-
</configuration>
6251-
6247+
</configuration>
62526248
```
62536249

62546250
When the configuration file is present, the example displays the following output:
62556251

62566252
```
6257-
6258-
String 'This is a string.' in domain 'PerDomain.exe': 5435776D
6259-
String 'This is a string.' in domain 'NewDomain': 75CC8236
6260-
6253+
String 'This is a string.' in domain 'PerDomain.exe': 5435776D
6254+
String 'This is a string.' in domain 'NewDomain': 75CC8236
62616255
```
62626256

62636257
> [!IMPORTANT]

0 commit comments

Comments
 (0)