From d256314c736c3f11a7888ff5d619ab1d992e5ffe Mon Sep 17 00:00:00 2001 From: Smaug123 Date: Fri, 13 Oct 2023 15:55:00 +0100 Subject: [PATCH 1/2] More stern warning about string culture comparison --- xml/System/String.xml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/xml/System/String.xml b/xml/System/String.xml index 0ef16d8abeb..a709a2bab8d 100644 --- a/xml/System/String.xml +++ b/xml/System/String.xml @@ -5287,7 +5287,7 @@ This method performs an ordinal (case-sensitive and culture-insensitive) compari is . - As explained in [Best Practices for Using Strings](/dotnet/standard/base-types/best-practices-strings), we recommend that you avoid calling string comparison methods that substitute default values and instead call methods that require parameters to be explicitly specified. To determine whether a string ends with a particular substring by using the string comparison rules of the current culture, signal your intention explicitly by calling the method overload with a value of for its parameter. + As explained in [Best Practices for Using Strings](/dotnet/standard/base-types/best-practices-strings), we recommend that you avoid calling string comparison methods that substitute default values and instead call methods that require parameters to be explicitly specified. To determine whether a string ends with a particular substring by using the string comparison rules of the current culture, signal your intention explicitly by calling the method overload with a value of for its parameter. Note that is rarely appropriate. @@ -8014,7 +8014,7 @@ The `GetPinnableReference` method returns a character that can be used for pinni is . - As explained in [Best Practices for Using Strings](/dotnet/standard/base-types/best-practices-strings), we recommend that you avoid calling string comparison methods that substitute default values and instead call methods that require parameters to be explicitly specified. To find the first index of a substring within a string instance by using the comparison rules of the current culture, signal your intention explicitly by calling the method overload with a value of for its `comparisonType` parameter. + As explained in [Best Practices for Using Strings](/dotnet/standard/base-types/best-practices-strings), we recommend that you avoid calling string comparison methods that substitute default values and instead call methods that require parameters to be explicitly specified. To find the first index of a substring within a string instance by using the comparison rules of the current culture, signal your intention explicitly by calling the method overload with a value of for its `comparisonType` parameter. Note that is rarely appropriate. @@ -8230,7 +8230,7 @@ The `comparisonType` parameter is a enumeration m is less than 0 (zero) or greater than the length of this string. - As explained in [Best Practices for Using Strings](/dotnet/standard/base-types/best-practices-strings), we recommend that you avoid calling string comparison methods that substitute default values and instead call methods that require parameters to be explicitly specified. To find the first index of a substring that occurs after a particular character position by using the comparison rules of the current culture, signal your intention explicitly by calling the method overload with a value of for its `comparisonType` parameter. + As explained in [Best Practices for Using Strings](/dotnet/standard/base-types/best-practices-strings), we recommend that you avoid calling string comparison methods that substitute default values and instead call methods that require parameters to be explicitly specified. To find the first index of a substring that occurs after a particular character position by using the comparison rules of the current culture, signal your intention explicitly by calling the method overload with a value of for its `comparisonType` parameter. Note that is rarely appropriate. @@ -8502,7 +8502,7 @@ The `comparisonType` parameter is a enumeration m is greater than the length of this string minus . - As explained in [Best Practices for Using Strings](/dotnet/standard/base-types/best-practices-strings), we recommend that you avoid calling string comparison methods that substitute default values and instead call methods that require parameters to be explicitly specified. To use the comparison rules of the current culture to perform this operation, signal your intention explicitly by calling the method overload with a value of for its `comparisonType` parameter. + As explained in [Best Practices for Using Strings](/dotnet/standard/base-types/best-practices-strings), we recommend that you avoid calling string comparison methods that substitute default values and instead call methods that require parameters to be explicitly specified. To use the comparison rules of the current culture to perform this operation, signal your intention explicitly by calling the method overload with a value of for its `comparisonType` parameter. Note that is rarely appropriate. @@ -10501,7 +10501,7 @@ In the following example, the is . - As explained in [Best Practices for Using Strings](/dotnet/standard/base-types/best-practices-strings), we recommend that you avoid calling string comparison methods that substitute default values and instead call methods that require parameters to be explicitly specified. To find the last index of a substring within a string instance by using the comparison rules of the current culture, signal your intention explicitly by calling the method overload with a value of for its parameter. + As explained in [Best Practices for Using Strings](/dotnet/standard/base-types/best-practices-strings), we recommend that you avoid calling string comparison methods that substitute default values and instead call methods that require parameters to be explicitly specified. To find the last index of a substring within a string instance by using the comparison rules of the current culture, signal your intention explicitly by calling the method overload with a value of for its parameter. Note that is rarely appropriate. @@ -10661,7 +10661,7 @@ In the following example, the , and is less than -1 or greater than zero. - As explained in [Best Practices for Using Strings](/dotnet/standard/base-types/best-practices-strings), we recommend that you avoid calling string comparison methods that substitute default values and instead call methods that require parameters to be explicitly specified. To find the index of a substring that precedes a particular character position by using the comparison rules of the current culture, signal your intention explicitly by calling the method overload with a value of for its parameter. + As explained in [Best Practices for Using Strings](/dotnet/standard/base-types/best-practices-strings), we recommend that you avoid calling string comparison methods that substitute default values and instead call methods that require parameters to be explicitly specified. To find the index of a substring that precedes a particular character position by using the comparison rules of the current culture, signal your intention explicitly by calling the method overload with a value of for its parameter. Note that is rarely appropriate. @@ -10950,7 +10950,7 @@ In the following example, the method is used The current instance equals and is greater than 1. - As explained in [Best Practices for Using Strings](/dotnet/standard/base-types/best-practices-strings), we recommend that you avoid calling string comparison methods that substitute default values and instead call methods that require parameters to be explicitly specified. To perform this operation by using the comparison rules of the current culture, signal your intention explicitly by calling the method overload with a value of for its parameter. + As explained in [Best Practices for Using Strings](/dotnet/standard/base-types/best-practices-strings), we recommend that you avoid calling string comparison methods that substitute default values and instead call methods that require parameters to be explicitly specified. To perform this operation by using the comparison rules of the current culture, signal your intention explicitly by calling the method overload with a value of for its parameter. Note that is rarely appropriate. @@ -13929,7 +13929,7 @@ The following example defines a `StripStartTags` method that uses the is . - As explained in [Best Practices for Using Strings](/dotnet/standard/base-types/best-practices-strings), we recommend that you avoid calling string comparison methods that substitute default values and instead call methods that require parameters to be explicitly specified. To determine whether a string begins with a particular substring by using the string comparison rules of the current culture, signal your intention explicitly by calling the method overload with a value of for its parameter. + As explained in [Best Practices for Using Strings](/dotnet/standard/base-types/best-practices-strings), we recommend that you avoid calling string comparison methods that substitute default values and instead call methods that require parameters to be explicitly specified. To determine whether a string begins with a particular substring by using the string comparison rules of the current culture, signal your intention explicitly by calling the method overload with a value of for its parameter. Note that is rarely appropriate. @@ -15953,7 +15953,7 @@ This member is an explicit interface member implementation. It can be used only ]]> - As explained in [Best Practices for Using Strings](/dotnet/standard/base-types/best-practices-strings), we recommend that you avoid calling string casing methods that substitute default values and instead call methods that require parameters to be explicitly specified. To convert a character to lowercase by using the casing conventions of the current culture, signal your intention explicitly by calling the method overload with a value of for its parameter. + As explained in [Best Practices for Using Strings](/dotnet/standard/base-types/best-practices-strings), we recommend that you avoid calling string casing methods that substitute default values and instead call methods that require parameters to be explicitly specified. To convert a character to lowercase by using the casing conventions of the current culture, signal your intention explicitly by calling the method overload with a value of for its parameter. Note that is rarely appropriate. @@ -16342,7 +16342,7 @@ This member is an explicit interface member implementation. It can be used only ]]> - As explained in [Best Practices for Using Strings](/dotnet/standard/base-types/best-practices-strings), we recommend that you avoid calling string casing methods that substitute default values and instead call methods that require parameters to be explicitly specified. To convert a string to uppercase by using the casing conventions of the current culture, signal your intention explicitly by calling the method overload with a value of for its parameter. + As explained in [Best Practices for Using Strings](/dotnet/standard/base-types/best-practices-strings), we recommend that you avoid calling string casing methods that substitute default values and instead call methods that require parameters to be explicitly specified. To convert a string to uppercase by using the casing conventions of the current culture, signal your intention explicitly by calling the method overload with a value of for its parameter. Note that is rarely appropriate. From b3a3dbd80dee33eabef7a41f9d86d71c893fada3 Mon Sep 17 00:00:00 2001 From: Smaug123 Date: Fri, 13 Oct 2023 17:40:19 +0100 Subject: [PATCH 2/2] Switch to a recommendation of Ordinal --- xml/System/String.xml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/xml/System/String.xml b/xml/System/String.xml index a709a2bab8d..02e6e1ea5a0 100644 --- a/xml/System/String.xml +++ b/xml/System/String.xml @@ -5287,7 +5287,7 @@ This method performs an ordinal (case-sensitive and culture-insensitive) compari is . - As explained in [Best Practices for Using Strings](/dotnet/standard/base-types/best-practices-strings), we recommend that you avoid calling string comparison methods that substitute default values and instead call methods that require parameters to be explicitly specified. To determine whether a string ends with a particular substring by using the string comparison rules of the current culture, signal your intention explicitly by calling the method overload with a value of for its parameter. Note that is rarely appropriate. + As explained in [Best Practices for Using Strings](/dotnet/standard/base-types/best-practices-strings), we recommend that you avoid calling string comparison methods that substitute default values and instead call methods that require parameters to be explicitly specified. To determine whether a string ends with a particular substring by using the string comparison rules of the current culture, signal your intention explicitly by calling the method overload with a value of for its parameter. If you don't need linguistic-aware comparison, consider using . @@ -8014,7 +8014,7 @@ The `GetPinnableReference` method returns a character that can be used for pinni is . - As explained in [Best Practices for Using Strings](/dotnet/standard/base-types/best-practices-strings), we recommend that you avoid calling string comparison methods that substitute default values and instead call methods that require parameters to be explicitly specified. To find the first index of a substring within a string instance by using the comparison rules of the current culture, signal your intention explicitly by calling the method overload with a value of for its `comparisonType` parameter. Note that is rarely appropriate. + As explained in [Best Practices for Using Strings](/dotnet/standard/base-types/best-practices-strings), we recommend that you avoid calling string comparison methods that substitute default values and instead call methods that require parameters to be explicitly specified. To find the first index of a substring within a string instance by using the comparison rules of the current culture, signal your intention explicitly by calling the method overload with a value of for its `comparisonType` parameter. If you don't need linguistic-aware comparison, consider using . @@ -8230,7 +8230,7 @@ The `comparisonType` parameter is a enumeration m is less than 0 (zero) or greater than the length of this string. - As explained in [Best Practices for Using Strings](/dotnet/standard/base-types/best-practices-strings), we recommend that you avoid calling string comparison methods that substitute default values and instead call methods that require parameters to be explicitly specified. To find the first index of a substring that occurs after a particular character position by using the comparison rules of the current culture, signal your intention explicitly by calling the method overload with a value of for its `comparisonType` parameter. Note that is rarely appropriate. + As explained in [Best Practices for Using Strings](/dotnet/standard/base-types/best-practices-strings), we recommend that you avoid calling string comparison methods that substitute default values and instead call methods that require parameters to be explicitly specified. To find the first index of a substring that occurs after a particular character position by using the comparison rules of the current culture, signal your intention explicitly by calling the method overload with a value of for its `comparisonType` parameter. If you don't need linguistic-aware comparison, consider using . @@ -8502,7 +8502,7 @@ The `comparisonType` parameter is a enumeration m is greater than the length of this string minus . - As explained in [Best Practices for Using Strings](/dotnet/standard/base-types/best-practices-strings), we recommend that you avoid calling string comparison methods that substitute default values and instead call methods that require parameters to be explicitly specified. To use the comparison rules of the current culture to perform this operation, signal your intention explicitly by calling the method overload with a value of for its `comparisonType` parameter. Note that is rarely appropriate. + As explained in [Best Practices for Using Strings](/dotnet/standard/base-types/best-practices-strings), we recommend that you avoid calling string comparison methods that substitute default values and instead call methods that require parameters to be explicitly specified. To use the comparison rules of the current culture to perform this operation, signal your intention explicitly by calling the method overload with a value of for its `comparisonType` parameter. If you don't need linguistic-aware comparison, consider using . @@ -10501,7 +10501,7 @@ In the following example, the is . - As explained in [Best Practices for Using Strings](/dotnet/standard/base-types/best-practices-strings), we recommend that you avoid calling string comparison methods that substitute default values and instead call methods that require parameters to be explicitly specified. To find the last index of a substring within a string instance by using the comparison rules of the current culture, signal your intention explicitly by calling the method overload with a value of for its parameter. Note that is rarely appropriate. + As explained in [Best Practices for Using Strings](/dotnet/standard/base-types/best-practices-strings), we recommend that you avoid calling string comparison methods that substitute default values and instead call methods that require parameters to be explicitly specified. To find the last index of a substring within a string instance by using the comparison rules of the current culture, signal your intention explicitly by calling the method overload with a value of for its parameter. If you don't need linguistic-aware comparison, consider using . @@ -10661,7 +10661,7 @@ In the following example, the , and is less than -1 or greater than zero. - As explained in [Best Practices for Using Strings](/dotnet/standard/base-types/best-practices-strings), we recommend that you avoid calling string comparison methods that substitute default values and instead call methods that require parameters to be explicitly specified. To find the index of a substring that precedes a particular character position by using the comparison rules of the current culture, signal your intention explicitly by calling the method overload with a value of for its parameter. Note that is rarely appropriate. + As explained in [Best Practices for Using Strings](/dotnet/standard/base-types/best-practices-strings), we recommend that you avoid calling string comparison methods that substitute default values and instead call methods that require parameters to be explicitly specified. To find the index of a substring that precedes a particular character position by using the comparison rules of the current culture, signal your intention explicitly by calling the method overload with a value of for its parameter. If you don't need linguistic-aware comparison, consider using . @@ -10950,7 +10950,7 @@ In the following example, the method is used The current instance equals and is greater than 1. - As explained in [Best Practices for Using Strings](/dotnet/standard/base-types/best-practices-strings), we recommend that you avoid calling string comparison methods that substitute default values and instead call methods that require parameters to be explicitly specified. To perform this operation by using the comparison rules of the current culture, signal your intention explicitly by calling the method overload with a value of for its parameter. Note that is rarely appropriate. + As explained in [Best Practices for Using Strings](/dotnet/standard/base-types/best-practices-strings), we recommend that you avoid calling string comparison methods that substitute default values and instead call methods that require parameters to be explicitly specified. To perform this operation by using the comparison rules of the current culture, signal your intention explicitly by calling the method overload with a value of for its parameter. If you don't need linguistic-aware comparison, consider using . @@ -13929,7 +13929,7 @@ The following example defines a `StripStartTags` method that uses the is . - As explained in [Best Practices for Using Strings](/dotnet/standard/base-types/best-practices-strings), we recommend that you avoid calling string comparison methods that substitute default values and instead call methods that require parameters to be explicitly specified. To determine whether a string begins with a particular substring by using the string comparison rules of the current culture, signal your intention explicitly by calling the method overload with a value of for its parameter. Note that is rarely appropriate. + As explained in [Best Practices for Using Strings](/dotnet/standard/base-types/best-practices-strings), we recommend that you avoid calling string comparison methods that substitute default values and instead call methods that require parameters to be explicitly specified. To determine whether a string begins with a particular substring by using the string comparison rules of the current culture, signal your intention explicitly by calling the method overload with a value of for its parameter. If you don't need linguistic-aware comparison, consider using . @@ -15953,7 +15953,7 @@ This member is an explicit interface member implementation. It can be used only ]]> - As explained in [Best Practices for Using Strings](/dotnet/standard/base-types/best-practices-strings), we recommend that you avoid calling string casing methods that substitute default values and instead call methods that require parameters to be explicitly specified. To convert a character to lowercase by using the casing conventions of the current culture, signal your intention explicitly by calling the method overload with a value of for its parameter. Note that is rarely appropriate. + As explained in [Best Practices for Using Strings](/dotnet/standard/base-types/best-practices-strings), we recommend that you avoid calling string casing methods that substitute default values and instead call methods that require parameters to be explicitly specified. To convert a character to lowercase by using the casing conventions of the current culture, signal your intention explicitly by calling the method overload with a value of for its parameter. If you don't need linguistic-aware comparison, consider using . @@ -16342,7 +16342,7 @@ This member is an explicit interface member implementation. It can be used only ]]> - As explained in [Best Practices for Using Strings](/dotnet/standard/base-types/best-practices-strings), we recommend that you avoid calling string casing methods that substitute default values and instead call methods that require parameters to be explicitly specified. To convert a string to uppercase by using the casing conventions of the current culture, signal your intention explicitly by calling the method overload with a value of for its parameter. Note that is rarely appropriate. + As explained in [Best Practices for Using Strings](/dotnet/standard/base-types/best-practices-strings), we recommend that you avoid calling string casing methods that substitute default values and instead call methods that require parameters to be explicitly specified. To convert a string to uppercase by using the casing conventions of the current culture, signal your intention explicitly by calling the method overload with a value of for its parameter. If you don't need linguistic-aware comparison, consider using .