diff --git a/xml/System.CodeDom.Compiler/CodeDomProvider.xml b/xml/System.CodeDom.Compiler/CodeDomProvider.xml index e2cc853e0d7..8f12c3d75f8 100644 --- a/xml/System.CodeDom.Compiler/CodeDomProvider.xml +++ b/xml/System.CodeDom.Compiler/CodeDomProvider.xml @@ -648,7 +648,7 @@ If more than one provider implementation is configured for the language name, returns a provider instance for the last matching configuration element. - Use the method overload when you want a specific language provider implementation. For example, use the method to get a provider instance that supports the language name `"CSharp"`; use the method overload to get a provider instance specifically for the implementation. You should use the [\], CultureInfo, Object\ method if you have multiple code providers for a language and you desire to instantiate a specific code provider. + Use the method overload when you want a specific language provider implementation. For example, use the method to get a provider instance that supports the language name `"CSharp"`; use the method overload to get a provider instance specifically for the implementation. Use the method if you have multiple code providers for a language and you desire to instantiate a specific code provider. The method checks whether at least one provider implementation supports a specific language. You can validate a language name using before passing it to . If you pass an unsupported language name to a is thrown. @@ -719,11 +719,11 @@ ## Remarks > [!NOTE] -> This method is most commonly used to create an instance of a code provider in an application that may optionally use one of several providers. enables you to specify at run time the version of the code provider you want to instantiate. If you know at design time which code provider is to be used, you should create an instance of that code provider instead of using the method. +> This method is most commonly used to create an instance of a code provider in an application that may optionally use one of several providers. enables you to specify at run time the version of the code provider you want to instantiate. If you know at design time which code provider is to be used, you should create an instance of that code provider instead of using the method. - Use when you want to dynamically find a configured provider implementation for a specific language and options. Language names are case-insensitive. For information about supported provider options, see the specific CodeDOM provider documentation. + Use when you want to dynamically find a configured provider implementation for a specific language and options. Language names are case-insensitive. For information about supported provider options, see the specific CodeDOM provider documentation. - For information about validating a provider and calling a provider if more than one provider implementation is configured for the language name, see the Remarks section of the method. + For information about validating a provider and calling a provider if more than one provider implementation is configured for the language name, see the Remarks section of the method. diff --git a/xml/System.Data.Linq/Binary.xml b/xml/System.Data.Linq/Binary.xml index 6b346502f9d..0035a552fb1 100644 --- a/xml/System.Data.Linq/Binary.xml +++ b/xml/System.Data.Linq/Binary.xml @@ -242,7 +242,7 @@ exception is thrown. Do not rely on this behavior because it may change in the future. + When `null` is passed to this operator instead of the required array of bytes, an exception is thrown. Do not rely on this behavior because it may change in the future. ]]> diff --git a/xml/System.Messaging/MessageQueue.xml b/xml/System.Messaging/MessageQueue.xml index 644e0ca846c..cbe967a0c4a 100644 --- a/xml/System.Messaging/MessageQueue.xml +++ b/xml/System.Messaging/MessageQueue.xml @@ -74,9 +74,7 @@ You can set the object's property with one of three names: the friendly name, the , or the . The friendly name, which is defined by the queue's and properties, is \\ for a public queue, and \\`Private$`\\ for a private queue. The property allows offline access to message queues. Lastly, you can use the queue's property to set the queue's . - For a list of initial property values for an instance of , see the constructor. - - + For a list of initial property values for an instance of , see the constructor. ## Examples The following code example creates new objects using various path name syntax types. In each case, it sends a message to the queue whose path is defined in the constructor. diff --git a/xml/System.Reflection.Emit/TypeBuilder.xml b/xml/System.Reflection.Emit/TypeBuilder.xml index c16c9a6f3a7..86e82675bdc 100644 --- a/xml/System.Reflection.Emit/TypeBuilder.xml +++ b/xml/System.Reflection.Emit/TypeBuilder.xml @@ -828,7 +828,7 @@ This overload is provided for designers of managed compilers. > [!NOTE] -> For more information on custom modifiers, see the ECMA Partition II Metadata documentation. The documentation is available online; see [ECMA C# and Common Language Infrastructure Standards](https://go.microsoft.com/fwlink/?LinkID=99212) on MSDN and [Standard ECMA-335 - Common Language Infrastructure (CLI)](https://go.microsoft.com/fwlink/?LinkID=65552) on the Ecma International Web site. +> For more information on custom modifiers, see [ECMA C# and Common Language Infrastructure Standards](/dotnet/standard/components#applicable-standards) and [Standard ECMA-335 - Common Language Infrastructure (CLI)](http://www.ecma-international.org/publications/standards/Ecma-335.htm). ]]> @@ -1617,7 +1617,7 @@ Use this overload if you need to specify custom modifiers. If you need to specify custom modifiers after the method has been created, as you would, for example, with a generic method whose parameter types are specified by its generic type parameters, you can use the or method overloads to define the method and then use the method to define the parameter and return types with custom modifiers. > [!NOTE] -> For more information on custom modifiers, see the ECMA Partition II Metadata documentation. The documentation is available online; see [ECMA C# and Common Language Infrastructure Standards](https://go.microsoft.com/fwlink/?LinkID=99212) on MSDN and [Standard ECMA-335 - Common Language Infrastructure (CLI)](https://go.microsoft.com/fwlink/?LinkID=65552) on the Ecma International Web site. +> For more information on custom modifiers, see [ECMA C# and Common Language Infrastructure Standards](/dotnet/standard/components#applicable-standards) and [Standard ECMA-335 - Common Language Infrastructure (CLI)](http://www.ecma-international.org/publications/standards/Ecma-335.htm). ]]> @@ -1694,12 +1694,10 @@ `DefineMethodOverride` defines a `methodimpl`, which consists of a pair of metadata tokens. One token points to an implementation, and the other token points to a declaration that the body implements. The body must be defined on the type the method impl is defined on, and the body must be virtual (`Overridable` in Visual Basic). The declaration can be made to a method defined on an interface implemented by the type, a method on a derived class, or a method defined in the type. If the declaration is on an interface only, the slot defined for the interface is altered. If the declaration is made to a method on a base type, the slot for the method is overridden and any duplicates for the overridden method are also replaced. The overridden method cannot be the actual method that is declared. If the method is on the same type, the slot is replaced and any duplicates for the replaced methods are overridden. > [!NOTE] -> For more information about method impls, see `MethodImpl` in the ECMA Partition II Metadata documentation. The documentation is available online; see [ECMA C# and Common Language Infrastructure Standards](https://go.microsoft.com/fwlink/?LinkID=99212) on MSDN and [Standard ECMA-335 - Common Language Infrastructure (CLI)](https://go.microsoft.com/fwlink/?LinkID=65552) on the Ecma International Web site. +> For more information about method impls, see `MethodImpl` in the ECMA Partition II Metadata documentation at [ECMA C# and Common Language Infrastructure Standards](/dotnet/standard/components#applicable-standards) and [Standard ECMA-335 - Common Language Infrastructure (CLI)](http://www.ecma-international.org/publications/standards/Ecma-335.htm). > [!IMPORTANT] -> After the method is called, some features of `methodInfoBody` cannot be changed. For example, you cannot apply an attribute to a generic type parameter of `methodInfoBody` by using the method. If you must use the method, do so after all characteristics of `methodInfoBody` have been defined. - - +> After the method is called, some features of `methodInfoBody` cannot be changed. For example, you cannot apply an attribute to a generic type parameter of `methodInfoBody` by using the method. If you must use the method, do so after all characteristics of `methodInfoBody` have been defined. ## Examples The following code example contains an interface `I` with a method `M()`, a base class `A` that implements the interface, and a derived class `C` that overrides the base class implementation of `M()` and also provides a separate explicit implementation of `I.M()`. @@ -2588,20 +2586,18 @@ Some DLL import attributes (see the description of ) cannot be specified as arguments to this method. For example, the DLL import attribute must be added after the `PInvoke` method is created, if the method returns a value. The example shows how to do this. > [!NOTE] -> For more information on custom modifiers, see the ECMA Partition II Metadata documentation. The documentation is available online; see [ECMA C# and Common Language Infrastructure Standards](https://go.microsoft.com/fwlink/?LinkID=99212) on MSDN and [Standard ECMA-335 - Common Language Infrastructure (CLI)](https://go.microsoft.com/fwlink/?LinkID=65552) on the Ecma International Web site. - - +> For more information on custom modifiers, see [ECMA C# and Common Language Infrastructure Standards](/dotnet/standard/components#applicable-standards) and [Standard ECMA-335 - Common Language Infrastructure (CLI)](http://www.ecma-international.org/publications/standards/Ecma-335.htm). ## Examples - The following code example demonstrates how to use the [\], Type\[\], Type\[\], Type\[\]\[\], Type\[\]\ method to create a `PInvoke` method, and how to add the flag to the method implementation flags after you create the , by using the and methods. + The following code example demonstrates how to use the method to create a `PInvoke` method, and how to add the flag to the method implementation flags after you create the , by using the and methods. The example creates a dynamic assembly with one dynamic module and a single type, `MyType`, that contains the `PInvoke` method. The `PInvoke` method represents the Win32 `GetTickCount` function. > [!IMPORTANT] -> To get a non-zero return value, you must add the flag. +> To get a non-zero return value, you must add the flag. > [!NOTE] -> The example uses an overload that does not specify custom modifiers. To specify custom modifiers, change the example code to use this method overload instead. +> The example uses an overload that does not specify custom modifiers. To specify custom modifiers, change the example code to use this method overload instead. When the example is run, it executes the `PInvoke` method. It also saves the dynamic assembly as PInvokeTest.dll. You can use the [Ildasm.exe (IL Disassembler)](/dotnet/framework/tools/ildasm-exe-il-disassembler) to examine the `MyType` class and the `static` (`Shared` in Visual Basic) `PInvoke` method it contains. You can compile a Visual Basic or C# program that uses the static `MyType.GetTickCount` method by including a reference to the DLL when you run csc.exe or vbc.exe; for example, `/r:PInvokeTest.dll`. @@ -2842,7 +2838,7 @@ This overload is provided for designers of managed compilers. > [!NOTE] -> For more information on custom modifiers, see the ECMA Partition II Metadata documentation. The documentation is available online; see [ECMA C# and Common Language Infrastructure Standards](https://go.microsoft.com/fwlink/?LinkID=99212) on MSDN and [Standard ECMA-335 - Common Language Infrastructure (CLI)](https://go.microsoft.com/fwlink/?LinkID=65552) on the Ecma International Web site. +> For more information on custom modifiers, see [ECMA C# and Common Language Infrastructure Standards](/dotnet/standard/components#applicable-standards) and [Standard ECMA-335 - Common Language Infrastructure (CLI)](http://www.ecma-international.org/publications/standards/Ecma-335.htm). ]]> @@ -2922,7 +2918,7 @@ This overload is provided for designers of managed compilers. > [!NOTE] -> For more information on custom modifiers, see the ECMA Partition II Metadata documentation. The documentation is available online; see [ECMA C# and Common Language Infrastructure Standards](https://go.microsoft.com/fwlink/?LinkID=99212) on MSDN and [Standard ECMA-335 - Common Language Infrastructure (CLI)](https://go.microsoft.com/fwlink/?LinkID=65552) on the Ecma International Web site. +> For more information on custom modifiers, see [ECMA C# and Common Language Infrastructure Standards](/dotnet/standard/components#applicable-standards) and [Standard ECMA-335 - Common Language Infrastructure (CLI)](http://www.ecma-international.org/publications/standards/Ecma-335.htm). This method overload is introduced in the [!INCLUDE[net_v35_long](~/includes/net-v35-long-md.md)] or later. @@ -6465,11 +6461,12 @@ [!NOTE] -> Starting with the [!INCLUDE[net_v20sp1_long](~/includes/net-v20sp1-long-md.md)], this member no longer requires with the flag. (See [Security Issues in Reflection Emit](/dotnet/framework/reflection-and-codedom/security-issues-in-reflection-emit).) To use this functionality, your application should target the [!INCLUDE[net_v35_long](~/includes/net-v35-long-md.md)] or later. +> Starting with the [!INCLUDE[net_v20sp1_long](~/includes/net-v20sp1-long-md.md)], this member no longer requires with the flag. (See [Security Issues in Reflection Emit](/dotnet/framework/reflection-and-codedom/security-issues-in-reflection-emit).) To use this functionality, your application should target the [!INCLUDE[net_v35_long](~/includes/net-v35-long-md.md)] or later. ]]> diff --git a/xml/System.Reflection/Assembly.xml b/xml/System.Reflection/Assembly.xml index 159180c802f..5ed6e3ae775 100644 --- a/xml/System.Reflection/Assembly.xml +++ b/xml/System.Reflection/Assembly.xml @@ -4105,13 +4105,13 @@ To load the correct assembly, it's recommended to call the `Load` method by pass - When you use a method overload with a `Byte[]` parameter to load a COFF image, evidence is inherited from the calling assembly. This applies to the .NET Framework version 1.1 Service Pack 1 (SP1) and subsequent releases. > [!NOTE] - > In the .NET Framework version 1.0 and in version 1.1 without SP1, when you use a method overload with a `Byte[]` parameter to load a COFF image, evidence is combined. `Zone`, `Url` and `Site` are inherited from the calling assembly, and `Hash` and `StrongName` are taken from the COFF assembly. + > In the .NET Framework version 1.0 and in version 1.1 without SP1, when you use a method overload with a `Byte[]` parameter to load a COFF image, evidence is combined. `Zone`, `Url` and `Site` are inherited from the calling assembly, and `Hash` and `StrongName` are taken from the COFF assembly. - When you use a method with a `Byte[]` parameter and to load a COFF image, only the supplied evidence is used. Evidence of the calling assembly and evidence of the COFF image are ignored. Reflecting on C++ executable files might throw a . This is most likely caused by the C++ compiler stripping the relocation addresses or the `.reloc` section from your executable file. To preserve the `.reloc` address for your C++ executable file, specify `/fixed:no` when you are linking. - If you call the [\], Byte\ method more than once on the same assembly but with a different evidence specified, the common language runtime does not throw a because the equality and integrity of the different evidence specifications cannot be determined. The evidence that first succeeds is the evidence that is used. + If you call the method more than once on the same assembly but with a different evidence specified, the common language runtime does not throw a because the equality and integrity of the different evidence specifications cannot be determined. The evidence that first succeeds is the evidence that is used. Note that this method overload always creates a new object with its own mapping. diff --git a/xml/System.Text.RegularExpressions/Regex.xml b/xml/System.Text.RegularExpressions/Regex.xml index f73d987cb11..08d144aaaca 100644 --- a/xml/System.Text.RegularExpressions/Regex.xml +++ b/xml/System.Text.RegularExpressions/Regex.xml @@ -152,7 +152,7 @@ How you handle the exception depends on the cause of the exception. If the exception occurs because the time-out interval is set too low or because of excessive machine load, you can increase the time-out interval and retry the matching operation. If the exception occurs because the regular expression relies on excessive backtracking, you can assume that a match does not exist, and, optionally, you can log information that will help you modify the regular expression pattern. - You can set a time-out interval by calling the constructor when you instantiate a regular expression object. For static methods, you can set a time-out interval by calling an overload of a matching method that has a `matchTimeout` parameter. If you do not set a time-out value explicitly, the default time-out value is determined as follows: + You can set a time-out interval by calling the constructor when you instantiate a regular expression object. For static methods, you can set a time-out interval by calling an overload of a matching method that has a `matchTimeout` parameter. If you do not set a time-out value explicitly, the default time-out value is determined as follows: - By using the application-wide time-out value, if one exists. This can be any time-out value that applies to the application domain in which the object is instantiated or the static method call is made. You can set the application-wide time-out value by calling the method to assign the string representation of a value to the "REGEX_DEFAULT_MATCH_TIMEOUT" property. @@ -325,11 +325,11 @@ ## Remarks The `pattern` parameter consists of regular expression language elements that symbolically describe the string to match. For more information about regular expressions, see the [.NET Framework Regular Expressions](/dotnet/standard/base-types/regular-expressions) and [Regular Expression Language - Quick Reference](/dotnet/standard/base-types/regular-expression-language-quick-reference) topics. - Calling the constructor is equivalent to calling the constructor with a value of for the `options` argument. + Calling the constructor is equivalent to calling the constructor with a value of for the `options` argument. A object is immutable, which means that it can be used only for the match pattern you define when you create it. However, it can be used any number of times without being recompiled. - This constructor instantiates a regular expression object that attempts a case-sensitive match of any alphabetical characters defined in `pattern`. For a case-insensitive match, use the constructor. + This constructor instantiates a regular expression object that attempts a case-sensitive match of any alphabetical characters defined in `pattern`. For a case-insensitive match, use the constructor. @@ -339,7 +339,7 @@ :::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Text.RegularExpressions.Regex.Constructors/cs/constructors1.cs" interactive="try-dotnet" id="Snippet1"::: :::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Text.RegularExpressions.Regex.Constructors/vb/constructors1.vb" id="Snippet1"::: - Note that the regular expression pattern cannot match the word "The" at the beginning of the text, because comparisons are case-sensitive by default. For an example of case-insensitive comparison, see the constructor. + Note that the regular expression pattern cannot match the word "The" at the beginning of the text, because comparisons are case-sensitive by default. For an example of case-insensitive comparison, see the constructor. ]]> @@ -539,7 +539,7 @@ ## Examples - The following example calls the constructor to instantiate a object with a time-out value of one second. The regular expression pattern `(a+)+$`, which matches one or more sequences of one or more "a" characters at the end of a line, is subject to excessive backtracking. If a is thrown, the example increases the time-out value up to the maximum value of three seconds. Otherwise, it abandons the attempt to match the pattern. + The following example calls the constructor to instantiate a object with a time-out value of one second. The regular expression pattern `(a+)+$`, which matches one or more sequences of one or more "a" characters at the end of a line, is subject to excessive backtracking. If a is thrown, the example increases the time-out value up to the maximum value of three seconds. Otherwise, it abandons the attempt to match the pattern. :::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.text.regularexpressions.regex.ctor/cs/ctor1.cs" interactive="try-dotnet" id="Snippet1"::: :::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.text.regularexpressions.regex.ctor/vb/ctor1.vb" id="Snippet1"::: @@ -711,7 +711,7 @@ ## Remarks Note that this property is protected; it can only be accessed from a class derived from the class. - A set operation attempts to convert the value assigned to the property to a object; if this conversion fails, it calls the constructor. + A set operation attempts to convert the value assigned to the property to a object; if this conversion fails, it calls the constructor. ]]> @@ -804,7 +804,7 @@ ## Remarks Note that this property is protected; it can only be accessed from a class derived from the class. - A set operation attempts to convert the value assigned to the property to a object; if this conversion fails, it calls the constructor. + A set operation attempts to convert the value assigned to the property to a object; if this conversion fails, it calls the constructor. ]]> @@ -950,7 +950,7 @@ On .NET Core, calls to the `Regex.CompileToAssembly` method throw a method generates a .NET Framework assembly in which each regular expression defined in the `regexinfos` array is represented by a class. Typically, the method is called from a separate application that generates an assembly of compiled regular expressions. Each regular expression included in the assembly has the following characteristics: + The method generates a .NET Framework assembly in which each regular expression defined in the `regexinfos` array is represented by a class. Typically, the method is called from a separate application that generates an assembly of compiled regular expressions. Each regular expression included in the assembly has the following characteristics: - It is derived from the class. @@ -1042,7 +1042,7 @@ On .NET Core, calls to the `Regex.CompileToAssembly` method throw a method generates a .NET Framework assembly in which each regular expression defined in the `regexinfos` array is represented by a class. Typically, the method is called from a separate application that generates an assembly of compiled regular expressions. Each regular expression included in the assembly has the following characteristics: + The method generates a .NET Framework assembly in which each regular expression defined in the `regexinfos` array is represented by a class. Typically, the method is called from a separate application that generates an assembly of compiled regular expressions. Each regular expression included in the assembly has the following characteristics: - It is derived from the class. @@ -1064,7 +1064,7 @@ On .NET Core, calls to the `Regex.CompileToAssembly` method throw a object by passing its constructor the object retrieved in step 3 and the array created in step 4. - You can then pass an array of these objects instead of the `attributes` parameter to the method. + You can then pass an array of these objects instead of the `attributes` parameter to the method. @@ -1152,7 +1152,7 @@ On .NET Core, calls to the `Regex.CompileToAssembly` method throw a method generates a .NET Framework assembly in which each regular expression defined in the `regexinfos` array is represented by a class. Typically, the [\], AssemblyName, CustomAttributeBuilder\ method is called from a separate application that generates an assembly of compiled regular expressions. Each regular expression included in the assembly has the following characteristics: + The method generates a .NET Framework assembly in which each regular expression defined in the `regexinfos` array is represented by a class. Typically, the method is called from a separate application that generates an assembly of compiled regular expressions. Each regular expression included in the assembly has the following characteristics: - It is derived from the class. @@ -1174,7 +1174,7 @@ On .NET Core, calls to the `Regex.CompileToAssembly` method throw a object by passing its constructor the object retrieved in step 3 and the array created in step 4. - You can then pass an array of these objects instead of the `attributes` parameter to the [\], AssemblyName, CustomAttributeBuilder\ method. + You can then pass an array of these objects instead of the `attributes` parameter to the method. ]]> @@ -1663,7 +1663,7 @@ Allows an to attempt to free resources and perfor class constructor and a number of static matching methods use the constant to indicate that the attempt to find a pattern match should not time out. + The class constructor and a number of static matching methods use the constant to indicate that the attempt to find a pattern match should not time out. > [!WARNING] > Setting the regular expression engine's time-out value to can cause regular expressions that rely on excessive backtracking to appear to stop responding when processing text that nearly matches the regular expression pattern. If you disable time-outs, you should ensure that your regular expression does not rely on excessive backtracking and that it handles text that nearly matches the regular expression pattern. @@ -1672,21 +1672,21 @@ Allows an to attempt to free resources and perfor The constant can be supplied as the value of the `matchTimeout` argument of the following members: -- +- -- +- -- +- -- +- -- +- -- +- -- +- -- +- ]]> @@ -1835,12 +1835,12 @@ Allows an to attempt to free resources and perfor ## Remarks The method is typically used to validate a string or to ensure that a string conforms to a particular pattern without retrieving that string for subsequent manipulation. If you want to determine whether one or more strings match a regular expression pattern and then retrieve them for subsequent manipulation, call the or method. - The exception is thrown if the execution time of the matching operation exceeds the time-out interval specified by the constructor. If you do not set a time-out interval when you call the constructor, the exception is thrown if the operation exceeds any time-out value established for the application domain in which the object is created. If no time-out is defined in the constructor call or in the application domain's properties, or if the time-out value is , no exception is thrown. + The exception is thrown if the execution time of the matching operation exceeds the time-out interval specified by the constructor. If you do not set a time-out interval when you call the constructor, the exception is thrown if the operation exceeds any time-out value established for the application domain in which the object is created. If no time-out is defined in the constructor call or in the application domain's properties, or if the time-out value is , no exception is thrown. ## Examples - The following example illustrates the use of the method to determine whether a string is a valid part number. The regular expression assumes that the part number has a specific format that consists of three sets of characters separated by hyphens. The first set, which contains four characters, must consist of an alphanumeric character followed by two numeric characters followed by an alphanumeric character. The second set, which consists of three characters, must be numeric. The third set, which consists of four characters, must have three numeric characters followed by an alphanumeric character. + The following example illustrates the use of the method to determine whether a string is a valid part number. The regular expression assumes that the part number has a specific format that consists of three sets of characters separated by hyphens. The first set, which contains four characters, must consist of an alphanumeric character followed by two numeric characters followed by an alphanumeric character. The second set, which consists of three characters, must be numeric. The third set, which consists of four characters, must have three numeric characters followed by an alphanumeric character. :::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.text.regularexpressions.regex.ismatch/cs/ismatch2.cs" interactive="try-dotnet" id="Snippet2"::: :::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.text.regularexpressions.regex.ismatch/vb/ismatch2.vb" id="Snippet2"::: @@ -1923,12 +1923,12 @@ Allows an to attempt to free resources and perfor ## Remarks The method is typically used to validate a string or to ensure that a string conforms to a particular pattern without retrieving that string for subsequent manipulation. If you want to determine whether one or more strings match a regular expression pattern and then retrieve them for subsequent manipulation, call the or method. - The exception is thrown if the execution time of the matching operation exceeds the time-out interval specified by the constructor. If you do not set a time-out interval when you call the constructor, the exception is thrown if the operation exceeds any time-out value established for the application domain in which the object is created. If no time-out is defined in the constructor call or in the application domain's properties, or if the time-out value is , no exception is thrown. + The exception is thrown if the execution time of the matching operation exceeds the time-out interval specified by the constructor. If you do not set a time-out interval when you call the constructor, the exception is thrown if the operation exceeds any time-out value established for the application domain in which the object is created. If no time-out is defined in the constructor call or in the application domain's properties, or if the time-out value is , no exception is thrown. ## Examples - The following example illustrates the use of the method to determine whether a string is a valid part number. It searches for a part number that follows a colon (:) character in a string. The method is used to determine the position of the colon character, which is then passed to the method. The regular expression assumes that the part number has a specific format that consists of three sets of characters separated by hyphens. The first set, which contains four characters, must consist of an alphanumeric character followed by two numeric characters followed by an alphanumeric character. The second set, which consists of three characters, must be numeric. The third set, which consists of four characters, must have three numeric characters followed by an alphanumeric character. + The following example illustrates the use of the method to determine whether a string is a valid part number. It searches for a part number that follows a colon (:) character in a string. The method is used to determine the position of the colon character, which is then passed to the method. The regular expression assumes that the part number has a specific format that consists of three sets of characters separated by hyphens. The first set, which contains four characters, must consist of an alphanumeric character followed by two numeric characters followed by an alphanumeric character. The second set, which consists of three characters, must be numeric. The third set, which consists of four characters, must have three numeric characters followed by an alphanumeric character. :::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.text.regularexpressions.regex.ismatch/cs/ismatch3.cs" interactive="try-dotnet" id="Snippet3"::: :::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.text.regularexpressions.regex.ismatch/vb/ismatch3.vb" id="Snippet3"::: @@ -2012,7 +2012,7 @@ Allows an to attempt to free resources and perfor ## Remarks The method is typically used to validate a string or to ensure that a string conforms to a particular pattern without retrieving that string for subsequent manipulation. If you want to determine whether one or more strings match a regular expression pattern and then retrieve them for subsequent manipulation, call the or method. - The static method is equivalent to constructing a object with the regular expression pattern specified by `pattern` and calling the instance method. This regular expression pattern is cached for rapid retrieval by the regular expression engine. + The static method is equivalent to constructing a object with the regular expression pattern specified by `pattern` and calling the instance method. This regular expression pattern is cached for rapid retrieval by the regular expression engine. The `pattern` parameter consists of regular expression language elements that symbolically describe the string to match. For more information about regular expressions, see [.NET Framework Regular Expressions](/dotnet/standard/base-types/regular-expressions) and [Regular Expression Language - Quick Reference](/dotnet/standard/base-types/regular-expression-language-quick-reference). @@ -2021,7 +2021,7 @@ Allows an to attempt to free resources and perfor ## Examples - The following example illustrates the use of the method to determine whether a string is a valid part number. The regular expression assumes that the part number has a specific format that consists of three sets of characters separated by hyphens. The first set, which contains four characters, must consist of an alphanumeric character followed by two numeric characters followed by an alphanumeric character. The second set, which consists of three characters, must be numeric. The third set, which consists of four characters, must have three numeric characters followed by an alphanumeric character. + The following example illustrates the use of the method to determine whether a string is a valid part number. The regular expression assumes that the part number has a specific format that consists of three sets of characters separated by hyphens. The first set, which contains four characters, must consist of an alphanumeric character followed by two numeric characters followed by an alphanumeric character. The second set, which consists of three characters, must be numeric. The third set, which consists of four characters, must have three numeric characters followed by an alphanumeric character. :::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.text.regularexpressions.regex.ismatch/cs/ismatch1.cs" interactive="try-dotnet" id="Snippet1"::: :::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.text.regularexpressions.regex.ismatch/vb/ismatch1.vb" id="Snippet1"::: @@ -2110,7 +2110,7 @@ Allows an to attempt to free resources and perfor ## Remarks The method is typically used to validate a string or to ensure that a string conforms to a particular pattern without retrieving that string for subsequent manipulation. If you want to determine whether one or more strings match a regular expression pattern and then retrieve them for subsequent manipulation, call the or method. - The static method is equivalent to constructing a object with the regular expression pattern specified by `pattern` and the regular expression options specified by `options` and calling the instance method. This regular expression pattern is cached for rapid retrieval by the regular expression engine. + The static method is equivalent to constructing a object with the regular expression pattern specified by `pattern` and the regular expression options specified by `options` and calling the instance method. This regular expression pattern is cached for rapid retrieval by the regular expression engine. The `pattern` parameter consists of regular expression language elements that symbolically describe the string to match. For more information about regular expressions, see [.NET Framework Regular Expressions](/dotnet/standard/base-types/regular-expressions) and [Regular Expression Language - Quick Reference](/dotnet/standard/base-types/regular-expression-language-quick-reference). @@ -2119,7 +2119,7 @@ Allows an to attempt to free resources and perfor ## Examples - The following example illustrates the use of the method to determine whether a string is a valid part number. The regular expression assumes that the part number has a specific format that consists of three sets of characters separated by hyphens. The first set, which contains four characters, must consist of an alphanumeric character followed by two numeric characters followed by an alphanumeric character. The second set, which consists of three characters, must be numeric. The third set, which consists of four characters, must have three numeric characters followed by an alphanumeric character. + The following example illustrates the use of the method to determine whether a string is a valid part number. The regular expression assumes that the part number has a specific format that consists of three sets of characters separated by hyphens. The first set, which contains four characters, must consist of an alphanumeric character followed by two numeric characters followed by an alphanumeric character. The second set, which consists of three characters, must be numeric. The third set, which consists of four characters, must have three numeric characters followed by an alphanumeric character. :::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.text.regularexpressions.regex.ismatch/cs/ismatch4.cs" interactive="try-dotnet" id="Snippet4"::: :::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.text.regularexpressions.regex.ismatch/vb/ismatch4.vb" id="Snippet4"::: @@ -2144,13 +2144,13 @@ Allows an to attempt to free resources and perfor |`[A-Z0-9]`|Match any single alphabetic character from `A` through `Z`, or any numeric character.| |`$`|End the match at the end of the string.| - Calling the method with the `options` parameter set to is equivalent to defining the following regular expression: + Calling the method with the `options` parameter set to is equivalent to defining the following regular expression: ``` [a-zA-Z0-9]\d{2}[a-zA-Z0-9](-\d{3}){2}[A-Za-z0-9] ``` - For comparison, see the example for the method. + For comparison, see the example for the method. ]]> @@ -2218,7 +2218,7 @@ Allows an to attempt to free resources and perfor ## Remarks The method is typically used to validate a string or to ensure that a string conforms to a particular pattern without retrieving that string for subsequent manipulation. If you want to determine whether one or more strings match a regular expression pattern and then retrieve them for subsequent manipulation, call the or method. - The static method is equivalent to constructing a object with the regular expression pattern specified by `pattern` and the regular expression options specified by `options` and calling the instance method. This regular expression pattern is cached for rapid retrieval by the regular expression engine. + The static method is equivalent to constructing a object with the regular expression pattern specified by `pattern` and the regular expression options specified by `options` and calling the instance method. This regular expression pattern is cached for rapid retrieval by the regular expression engine. The `pattern` parameter consists of regular expression language elements that symbolically describe the string to match. For more information about regular expressions, see [.NET Framework Regular Expressions](/dotnet/standard/base-types/regular-expressions) and [Regular Expression Language - Quick Reference](/dotnet/standard/base-types/regular-expression-language-quick-reference). @@ -2227,7 +2227,7 @@ Allows an to attempt to free resources and perfor ## Examples - The following example illustrates the use of the method to determine whether a string is a valid part number. The regular expression assumes that the part number has a specific format that consists of three sets of characters separated by hyphens. The first set, which contains four characters, must consist of an alphanumeric character followed by two numeric characters followed by an alphanumeric character. The second set, which consists of three characters, must be numeric. The third set, which consists of four characters, must have three numeric characters followed by an alphanumeric character. Matching the regular expression pattern should involve minimal searching through the input string, so the method sets a time-out interval of 500 milliseconds. + The following example illustrates the use of the method to determine whether a string is a valid part number. The regular expression assumes that the part number has a specific format that consists of three sets of characters separated by hyphens. The first set, which contains four characters, must consist of an alphanumeric character followed by two numeric characters followed by an alphanumeric character. The second set, which consists of three characters, must be numeric. The third set, which consists of four characters, must have three numeric characters followed by an alphanumeric character. Matching the regular expression pattern should involve minimal searching through the input string, so the method sets a time-out interval of 500 milliseconds. :::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.text.regularexpressions.regex.ismatch/cs/ismatch5.cs" interactive="try-dotnet" id="Snippet5"::: :::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.text.regularexpressions.regex.ismatch/vb/ismatch5.vb" id="Snippet5"::: @@ -2252,13 +2252,13 @@ Allows an to attempt to free resources and perfor |`[A-Z0-9]`|Match any single alphabetic character from `A` through `Z`, or any numeric character.| |`$`|End the match at the end of the string.| - Calling the method with the `options` parameter set to is equivalent to defining the following regular expression: + Calling the method with the `options` parameter set to is equivalent to defining the following regular expression: ``` [a-zA-Z0-9]\d{2}[a-zA-Z0-9](-\d{3}){2}[A-Za-z0-9] ``` - For comparison, see the example for the method. + For comparison, see the example for the method. ]]> @@ -2343,13 +2343,13 @@ Allows an to attempt to free resources and perfor method returns the first substring that matches a regular expression pattern in an input string. For information about the language elements used to build a regular expression pattern, see [Regular Expression Language - Quick Reference](/dotnet/standard/base-types/regular-expression-language-quick-reference). + The method returns the first substring that matches a regular expression pattern in an input string. For information about the language elements used to build a regular expression pattern, see [Regular Expression Language - Quick Reference](/dotnet/standard/base-types/regular-expression-language-quick-reference). You can determine whether the regular expression pattern has been found in the input string by checking the value of the returned object's property. If a match is found, the returned object's property contains the substring from `input` that matches the regular expression pattern. If no match is found, its value is . - This method returns the first substring in `input` that matches the regular expression pattern. You can retrieve subsequent matches by repeatedly calling the returned object's method. You can also retrieve all matches in a single method call by calling the method. + This method returns the first substring in `input` that matches the regular expression pattern. You can retrieve subsequent matches by repeatedly calling the returned object's method. You can also retrieve all matches in a single method call by calling the method. - The exception is thrown if the execution time of the matching operation exceeds the time-out interval specified by the constructor. If you do not set a time-out interval when you call the constructor, the exception is thrown if the operation exceeds any time-out value established for the application domain in which the object is created. If no time-out is defined in the constructor call or in the application domain's properties, or if the time-out value is , no exception is thrown. + The exception is thrown if the execution time of the matching operation exceeds the time-out interval specified by the constructor. If you do not set a time-out interval when you call the constructor, the exception is thrown if the operation exceeds any time-out value established for the application domain in which the object is created. If no time-out is defined in the constructor call or in the application domain's properties, or if the time-out value is , no exception is thrown. @@ -2424,9 +2424,9 @@ Allows an to attempt to free resources and perfor method returns the first substring that matches a regular expression pattern, starting at or after the `startat` character position, in an input string. For information about the language elements used to build a regular expression pattern, see [Regular Expression Language - Quick Reference](/dotnet/standard/base-types/regular-expression-language-quick-reference). + The method returns the first substring that matches a regular expression pattern, starting at or after the `startat` character position, in an input string. For information about the language elements used to build a regular expression pattern, see [Regular Expression Language - Quick Reference](/dotnet/standard/base-types/regular-expression-language-quick-reference). - The regular expression pattern for which the method searches is defined by the call to one of the class constructors. For more information about the elements that can form a regular expression pattern, see [Regular Expression Language - Quick Reference](/dotnet/standard/base-types/regular-expression-language-quick-reference). + The regular expression pattern for which the method searches is defined by the call to one of the class constructors. For more information about the elements that can form a regular expression pattern, see [Regular Expression Language - Quick Reference](/dotnet/standard/base-types/regular-expression-language-quick-reference). You can optionally specify a starting position in the string by using the `startat` parameter. When the regular expression engine parses from left to right (the default), the match and the scan move rightward, starting at the character specified in `startat`. When the regular expression engine parses from right to left (when the regular expression pattern is constructed with the option), the match and scan move in the opposite direction and begin with the character at `startat` -1. If you do not specify a starting position, the search begins at the default `startat` position. If the regular expression searches from left to right, the default `startat` position is at the left end of `input`; if it searches from right to left, the default `startat` position is at the right end of `input`. @@ -2434,9 +2434,9 @@ Allows an to attempt to free resources and perfor You can determine whether the regular expression pattern has been found in the input string by checking the value of the returned object's property. If a match is found, the returned object's property contains the substring from `input` that matches the regular expression pattern. If no match is found, its value is . - This method returns the first substring found at or after the `startat` character position in `input` that matches the regular expression pattern. You can retrieve subsequent matches by repeatedly calling the returned object's method. You can also retrieve all matches in a single method call by calling the method. + This method returns the first substring found at or after the `startat` character position in `input` that matches the regular expression pattern. You can retrieve subsequent matches by repeatedly calling the returned object's method. You can also retrieve all matches in a single method call by calling the method. - The exception is thrown if the execution time of the matching operation exceeds the time-out interval specified by the constructor. If you do not set a time-out interval when you call the constructor, the exception is thrown if the operation exceeds any time-out value established for the application domain in which the object is created. If no time-out is defined in the constructor call or in the application domain's properties, or if the time-out value is , no exception is thrown. + The exception is thrown if the execution time of the matching operation exceeds the time-out interval specified by the constructor. If you do not set a time-out interval when you call the constructor, the exception is thrown if the operation exceeds any time-out value established for the application domain in which the object is created. If no time-out is defined in the constructor call or in the application domain's properties, or if the time-out value is , no exception is thrown. ]]> @@ -2496,22 +2496,22 @@ Allows an to attempt to free resources and perfor method returns the first substring that matches a regular expression pattern in an input string. For information about the language elements used to build a regular expression pattern, see [Regular Expression Language - Quick Reference](/dotnet/standard/base-types/regular-expression-language-quick-reference). + The method returns the first substring that matches a regular expression pattern in an input string. For information about the language elements used to build a regular expression pattern, see [Regular Expression Language - Quick Reference](/dotnet/standard/base-types/regular-expression-language-quick-reference). - The static method is equivalent to constructing a object with the specified regular expression pattern and calling the instance method. In this case, the regular expression engine caches the regular expression pattern. + The static method is equivalent to constructing a object with the specified regular expression pattern and calling the instance method. In this case, the regular expression engine caches the regular expression pattern. The `pattern` parameter consists of regular expression language elements that symbolically describe the string to match. For more information about regular expressions, see [.NET Framework Regular Expressions](/dotnet/standard/base-types/regular-expressions) and [Regular Expression Language - Quick Reference](/dotnet/standard/base-types/regular-expression-language-quick-reference). You can determine whether the regular expression pattern has been found in the input string by checking the value of the returned object's property. If a match is found, the returned object's property contains the substring from `input` that matches the regular expression pattern. If no match is found, its value is . - This method returns the first substring in `input` that matches the regular expression pattern. You can retrieve subsequent matches by repeatedly calling the returned object's method. You can also retrieve all matches in a single method call by calling the method. + This method returns the first substring in `input` that matches the regular expression pattern. You can retrieve subsequent matches by repeatedly calling the returned object's method. You can also retrieve all matches in a single method call by calling the method. The exception is thrown if the execution time of the matching operation exceeds the time-out interval specified for the application domain in which the method is called. If no time-out is defined in the application domain's properties, or if the time-out value is , no exception is thrown. ## Examples - The following example calls the method to find the first word that contains at least one `z` character, and then calls the method to find any additional matches. + The following example calls the method to find the first word that contains at least one `z` character, and then calls the method to find any additional matches. :::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.text.regularexpressions.regex.match/cs/match1.cs" interactive="try-dotnet" id="Snippet1"::: :::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.text.regularexpressions.regex.match/vb/match1.vb" id="Snippet1"::: @@ -2588,15 +2588,15 @@ Allows an to attempt to free resources and perfor method returns the first substring that matches a regular expression pattern in a portion of an input string. For information about the language elements used to build a regular expression pattern, see [Regular Expression Language - Quick Reference](/dotnet/standard/base-types/regular-expression-language-quick-reference). + The method returns the first substring that matches a regular expression pattern in a portion of an input string. For information about the language elements used to build a regular expression pattern, see [Regular Expression Language - Quick Reference](/dotnet/standard/base-types/regular-expression-language-quick-reference). - The regular expression pattern for which the method searches is defined by the call to one of the class constructors. For more information about the elements that can form a regular expression pattern, see [Regular Expression Language - Quick Reference](/dotnet/standard/base-types/regular-expression-language-quick-reference). + The regular expression pattern for which the method searches is defined by the call to one of the class constructors. For more information about the elements that can form a regular expression pattern, see [Regular Expression Language - Quick Reference](/dotnet/standard/base-types/regular-expression-language-quick-reference). - The method searches the portion of `input` defined by the `beginning` and `length` parameters for the regular expression pattern. `beginning` always defines the index of the leftmost character to include in the search, and `length` defines the maximum number of characters to search. Together, they define the range of the search. If the search proceeds from left to right (the default), the regular expression engine searches from the character at index `beginning` to the character at index `beginning` + `length` - 1. If the regular expression engine was instantiated by using the option so that the search proceeds from right to left, the regular expression engine searches from the character at index `beginning` + `length` - 1 to the character at index `beginning`. This method returns the first match that it finds within this range. You can retrieve subsequent matches by repeatedly calling the returned object's method. + The method searches the portion of `input` defined by the `beginning` and `length` parameters for the regular expression pattern. `beginning` always defines the index of the leftmost character to include in the search, and `length` defines the maximum number of characters to search. Together, they define the range of the search. If the search proceeds from left to right (the default), the regular expression engine searches from the character at index `beginning` to the character at index `beginning` + `length` - 1. If the regular expression engine was instantiated by using the option so that the search proceeds from right to left, the regular expression engine searches from the character at index `beginning` + `length` - 1 to the character at index `beginning`. This method returns the first match that it finds within this range. You can retrieve subsequent matches by repeatedly calling the returned object's method. You can determine whether the regular expression pattern has been found in the input string by checking the value of the returned object's property. If a match is found, the returned object's property contains the substring from `input` that matches the regular expression pattern. If no match is found, its value is . - The exception is thrown if the execution time of the matching operation exceeds the time-out interval specified by the constructor. If you do not set a time-out value when you call the constructor, the exception is thrown if the operation exceeds any time-out value established for the application domain in which the object is created. If no time-out is defined in the constructor call or in the application domain's properties, or if the time-out value is , no exception is thrown. + The exception is thrown if the execution time of the matching operation exceeds the time-out interval specified by the constructor. If you do not set a time-out value when you call the constructor, the exception is thrown if the operation exceeds any time-out value established for the application domain in which the object is created. If no time-out is defined in the constructor call or in the application domain's properties, or if the time-out value is , no exception is thrown. ]]> @@ -2666,15 +2666,15 @@ Allows an to attempt to free resources and perfor method returns the first substring that matches a regular expression pattern in an input string. For information about the language elements used to build a regular expression pattern, see [Regular Expression Language - Quick Reference](/dotnet/standard/base-types/regular-expression-language-quick-reference). + The method returns the first substring that matches a regular expression pattern in an input string. For information about the language elements used to build a regular expression pattern, see [Regular Expression Language - Quick Reference](/dotnet/standard/base-types/regular-expression-language-quick-reference). - The static method is equivalent to constructing a object with the constructor and calling the instance method. + The static method is equivalent to constructing a object with the constructor and calling the instance method. The `pattern` parameter consists of regular expression language elements that symbolically describe the string to match. For more information about regular expressions, see [.NET Framework Regular Expressions](/dotnet/standard/base-types/regular-expressions) and [Regular Expression Language - Quick Reference](/dotnet/standard/base-types/regular-expression-language-quick-reference). You can determine whether the regular expression pattern has been found in the input string by checking the value of the returned object's property. If a match is found, the returned object's property contains the substring from `input` that matches the regular expression pattern. If no match is found, its value is . - This method returns the first substring found in `input` that matches the regular expression pattern. You can retrieve subsequent matches by repeatedly calling the returned object's method. You can also retrieve all matches in a single method call by calling the method. + This method returns the first substring found in `input` that matches the regular expression pattern. You can retrieve subsequent matches by repeatedly calling the returned object's method. You can also retrieve all matches in a single method call by calling the method. The exception is thrown if the execution time of the matching operation exceeds the time-out interval specified for the application domain in which the method is called. If no time-out is defined in the application domain's properties, or if the time-out value is , no exception is thrown. @@ -2759,15 +2759,15 @@ Allows an to attempt to free resources and perfor method returns the first substring that matches a regular expression pattern in an input string. For information about the language elements used to build a regular expression pattern, see [Regular Expression Language - Quick Reference](/dotnet/standard/base-types/regular-expression-language-quick-reference). + The method returns the first substring that matches a regular expression pattern in an input string. For information about the language elements used to build a regular expression pattern, see [Regular Expression Language - Quick Reference](/dotnet/standard/base-types/regular-expression-language-quick-reference). - The static method is equivalent to constructing a object with the constructor and calling the instance method. + The static method is equivalent to constructing a object with the constructor and calling the instance method. The `pattern` parameter consists of regular expression language elements that symbolically describe the string to match. For more information about regular expressions, see [.NET Framework Regular Expressions](/dotnet/standard/base-types/regular-expressions) and [Regular Expression Language - Quick Reference](/dotnet/standard/base-types/regular-expression-language-quick-reference). You can determine whether the regular expression pattern has been found in the input string by checking the value of the returned object's property. If a match is found, the returned object's property contains the substring from `input` that matches the regular expression pattern. If no match is found, its value is . - This method returns the first substring found in `input` that matches the regular expression pattern. You can retrieve subsequent matches by repeatedly calling the returned object's method. You can also retrieve all matches in a single method call by calling the method. + This method returns the first substring found in `input` that matches the regular expression pattern. You can retrieve subsequent matches by repeatedly calling the returned object's method. You can also retrieve all matches in a single method call by calling the method. The `matchTimeout` parameter specifies how long a pattern matching method should try to find a match before it times out. Setting a time-out interval prevents regular expressions that rely on excessive backtracking from appearing to stop responding when they process input that contains near matches. For more information, see [Best Practices for Regular Expressions](/dotnet/standard/base-types/best-practices) and [Backtracking](/dotnet/standard/base-types/backtracking-in-regular-expressions). If no match is found in that time interval, the method throws a exception. `matchTimeout` overrides any default time-out value defined for the application domain in which the method executes. @@ -2862,23 +2862,23 @@ Allows an to attempt to free resources and perfor method is similar to the method, except that it returns information about all the matches found in the input string, instead of a single match. It is equivalent to the following code: + The method is similar to the method, except that it returns information about all the matches found in the input string, instead of a single match. It is equivalent to the following code: [!code-csharp[System.Text.RegularExpressions.Regex.Matches#5](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.text.regularexpressions.regex.matches/cs/matchespattern.cs#5)] [!code-vb[System.Text.RegularExpressions.Regex.Matches#5](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.text.regularexpressions.regex.matches/vb/matchespattern.vb#5)] The collection includes only matches and terminates at the first non-match. - The regular expression pattern for which the method searches is defined by the call to one of the class constructors. For more information about the elements that can form a regular expression pattern, see [Regular Expression Language - Quick Reference](/dotnet/standard/base-types/regular-expression-language-quick-reference). + The regular expression pattern for which the method searches is defined by the call to one of the class constructors. For more information about the elements that can form a regular expression pattern, see [Regular Expression Language - Quick Reference](/dotnet/standard/base-types/regular-expression-language-quick-reference). The method uses lazy evaluation to populate the returned object. Accessing members of this collection such as and causes the collection to be populated immediately. To take advantage of lazy evaluation, you should iterate the collection by using a construct such as `foreach` in C# and `For Each`…`Next` in Visual Basic. - Because of its lazy evaluation, calling the method does not throw a exception. However, the exception is thrown when an operation is performed on the object returned by this method, if the property is not and a matching operation exceeds the time-out interval. + Because of its lazy evaluation, calling the method does not throw a exception. However, the exception is thrown when an operation is performed on the object returned by this method, if the property is not and a matching operation exceeds the time-out interval. ## Examples - The following example uses the method to identify any words in a sentence that end in "es". + The following example uses the method to identify any words in a sentence that end in "es". :::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.text.regularexpressions.regex.matches/cs/matches1.cs" interactive="try-dotnet" id="Snippet1"::: :::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.text.regularexpressions.regex.matches/vb/matches1.vb" id="Snippet1"::: @@ -2946,21 +2946,21 @@ Allows an to attempt to free resources and perfor method is similar to the method, except that it returns information about all the matches found in the input string, instead of a single match. It is equivalent to the following code: + The method is similar to the method, except that it returns information about all the matches found in the input string, instead of a single match. It is equivalent to the following code: [!code-csharp[System.Text.RegularExpressions.Regex.Matches#6](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.text.regularexpressions.regex.matches/cs/matchespattern.cs#6)] [!code-vb[System.Text.RegularExpressions.Regex.Matches#6](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.text.regularexpressions.regex.matches/vb/matchespattern.vb#6)] - The regular expression pattern for which the method searches is defined by the call to one of the class constructors. For more information about the elements that can form a regular expression pattern, see [Regular Expression Language - Quick Reference](/dotnet/standard/base-types/regular-expression-language-quick-reference). + The regular expression pattern for which the method searches is defined by the call to one of the class constructors. For more information about the elements that can form a regular expression pattern, see [Regular Expression Language - Quick Reference](/dotnet/standard/base-types/regular-expression-language-quick-reference). The method uses lazy evaluation to populate the returned object. Accessing members of this collection such as and causes the collection to be populated immediately. To take advantage of lazy evaluation, you should iterate the collection by using a construct such as `foreach` in C# and `For Each`…`Next` in Visual Basic. - Because of its lazy evaluation, calling the method does not throw a exception. However, the exception is thrown when an operation is performed on the object returned by this method, if the property is not and a matching operation exceeds the time-out interval. + Because of its lazy evaluation, calling the method does not throw a exception. However, the exception is thrown when an operation is performed on the object returned by this method, if the property is not and a matching operation exceeds the time-out interval. ## Examples - The following example uses the method to find the first word in a sentence that ends in "es", and then calls the method to identify any additional words that end in "es". + The following example uses the method to find the first word in a sentence that ends in "es", and then calls the method to identify any additional words that end in "es". :::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.text.regularexpressions.regex.matches/cs/matches3.cs" interactive="try-dotnet" id="Snippet3"::: :::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.text.regularexpressions.regex.matches/vb/matches3.vb" id="Snippet3"::: @@ -3030,7 +3030,7 @@ Allows an to attempt to free resources and perfor method is similar to the method, except that it returns information about all the matches found in the input string, instead of a single match. It is equivalent to the following code: + The method is similar to the method, except that it returns information about all the matches found in the input string, instead of a single match. It is equivalent to the following code: [!code-csharp[System.Text.RegularExpressions.Regex.Matches#7](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.text.regularexpressions.regex.matches/cs/matchespattern.cs#7)] [!code-vb[System.Text.RegularExpressions.Regex.Matches#7](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.text.regularexpressions.regex.matches/vb/matchespattern.vb#7)] @@ -3041,12 +3041,12 @@ Allows an to attempt to free resources and perfor The method uses lazy evaluation to populate the returned object. Accessing members of this collection such as and causes the collection to be populated immediately. To take advantage of lazy evaluation, you should iterate the collection by using a construct such as `foreach` in C# and `For Each`…`Next` in Visual Basic. - Because of its lazy evaluation, calling the method does not throw a exception. However, the exception is thrown when an operation is performed on the object returned by this method, if a time-out interval is defined by the "REGEX_DEFAULT_MATCH_TIMEOUT" property of the current application domain and a matching operation exceeds this time-out interval. + Because of its lazy evaluation, calling the method does not throw a exception. However, the exception is thrown when an operation is performed on the object returned by this method, if a time-out interval is defined by the "REGEX_DEFAULT_MATCH_TIMEOUT" property of the current application domain and a matching operation exceeds this time-out interval. ## Examples - The following example uses the method to identify any word in a sentence that ends in "es". + The following example uses the method to identify any word in a sentence that ends in "es". :::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.text.regularexpressions.regex.matches/cs/matches2.cs" interactive="try-dotnet" id="Snippet2"::: :::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.text.regularexpressions.regex.matches/vb/matches2.vb" id="Snippet2"::: @@ -3120,7 +3120,7 @@ Allows an to attempt to free resources and perfor method is similar to the method, except that it returns information about all the matches found in the input string, instead of a single match. It is equivalent to the following code: + The method is similar to the method, except that it returns information about all the matches found in the input string, instead of a single match. It is equivalent to the following code: [!code-csharp[System.Text.RegularExpressions.Regex.Matches#8](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.text.regularexpressions.regex.matches/cs/matchespattern.cs#8)] [!code-vb[System.Text.RegularExpressions.Regex.Matches#8](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.text.regularexpressions.regex.matches/vb/matchespattern.vb#8)] @@ -3131,12 +3131,12 @@ Allows an to attempt to free resources and perfor The method uses lazy evaluation to populate the returned object. Accessing members of this collection such as and causes the collection to be populated immediately. To take advantage of lazy evaluation, you should iterate the collection by using a construct such as `foreach` in C# and `For Each`…`Next` in Visual Basic. - Because of its lazy evaluation, calling the method does not throw a exception. However, the exception is thrown when an operation is performed on the object returned by this method, if a time-out interval is defined by the "REGEX_DEFAULT_MATCH_TIMEOUT" property of the current application domain and a matching operation exceeds this time-out interval. + Because of its lazy evaluation, calling the method does not throw a exception. However, the exception is thrown when an operation is performed on the object returned by this method, if a time-out interval is defined by the "REGEX_DEFAULT_MATCH_TIMEOUT" property of the current application domain and a matching operation exceeds this time-out interval. ## Examples - The following example calls the method to identify any word in a sentence that ends in "es", and then calls the method to perform a case-insensitive comparison of the pattern with the input string. As the output shows, the two methods return different results. + The following example calls the method to identify any word in a sentence that ends in "es", and then calls the method to perform a case-insensitive comparison of the pattern with the input string. As the output shows, the two methods return different results. :::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.text.regularexpressions.regex.matches/cs/matches4.cs" interactive="try-dotnet" id="Snippet4"::: :::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.text.regularexpressions.regex.matches/vb/matches4.vb" id="Snippet4"::: @@ -3212,7 +3212,7 @@ Allows an to attempt to free resources and perfor method is similar to the method, except that it returns information about all the matches found in the input string, instead of a single match. It is equivalent to the following code: + The method is similar to the method, except that it returns information about all the matches found in the input string, instead of a single match. It is equivalent to the following code: [!code-csharp[System.Text.RegularExpressions.Regex.Matches#10](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.text.regularexpressions.regex.matches/cs/matchespattern.cs#10)] [!code-vb[System.Text.RegularExpressions.Regex.Matches#10](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.text.regularexpressions.regex.matches/vb/matchespattern.vb#10)] @@ -3228,7 +3228,7 @@ Allows an to attempt to free resources and perfor ## Examples - The following example calls the method to perform a case-sensitive comparison that matches any word in a sentence that ends in "es". It then calls the method to perform a case-insensitive comparison of the pattern with the input string. In both cases, the time-out interval is set to one second. As the output shows, the two methods return different results. + The following example calls the method to perform a case-sensitive comparison that matches any word in a sentence that ends in "es". It then calls the method to perform a case-insensitive comparison of the pattern with the input string. In both cases, the time-out interval is set to one second. As the output shows, the two methods return different results. :::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.text.regularexpressions.regex.matches/cs/matches5.cs" interactive="try-dotnet" id="Snippet11"::: :::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.text.regularexpressions.regex.matches/vb/matches5.vb" id="Snippet11"::: @@ -3306,7 +3306,7 @@ Allows an to attempt to free resources and perfor ## Remarks The property defines the approximate maximum time interval for a instance to execute a single matching operation before the operation times out. The regular expression engine throws a exception during its next timing check after the time-out interval has elapsed. This prevents the regular expression engine from processing input strings that require excessive backtracking. For more information, see [Backtracking](/dotnet/standard/base-types/backtracking-in-regular-expressions) and [Best Practices for Regular Expressions](/dotnet/standard/base-types/best-practices). - This property is read-only. You can set its value explicitly for an individual object by calling the constructor; and you can set its value for all matching operations in an application domain by calling the method and providing a value for the "REGEX_DEFAULT_MATCH_TIMEOUT" property, as the following example illustrates. + This property is read-only. You can set its value explicitly for an individual object by calling the constructor; and you can set its value for all matching operations in an application domain by calling the method and providing a value for the "REGEX_DEFAULT_MATCH_TIMEOUT" property, as the following example illustrates. :::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.text.regularexpressions.regex.matchtimeout/cs/regexmatchtimeout1.cs" interactive="try-dotnet" id="Snippet1"::: :::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.text.regularexpressions.regex.matchtimeout/vb/regexmatchtimeout1.vb" id="Snippet1"::: @@ -3485,7 +3485,7 @@ Allows an to attempt to free resources and perfor > [!NOTE] > Substitutions are the only regular expression language elements that are recognized in a replacement pattern. All other regular expression language elements, including [character escapes](/dotnet/standard/base-types/character-escapes-in-regular-expressions), are allowed in regular expression patterns only and are not recognized in replacement patterns. - The exception is thrown if the execution time of the replacement operation exceeds the time-out interval specified by the constructor. If you do not set a time-out interval when you call the constructor, the exception is thrown if the operation exceeds any time-out value established for the application domain in which the object is created. If no time-out is defined in the constructor call or in the application domain's properties, or if the time-out value is , no exception is thrown + The exception is thrown if the execution time of the replacement operation exceeds the time-out interval specified by the constructor. If you do not set a time-out interval when you call the constructor, the exception is thrown if the operation exceeds any time-out value established for the application domain in which the object is created. If no time-out is defined in the constructor call or in the application domain's properties, or if the time-out value is , no exception is thrown Because the method returns `input` unchanged if there is no match, you can use the method to determine whether the method has made any replacements to the input string. @@ -3512,7 +3512,7 @@ Allows an to attempt to free resources and perfor |`\d+`|Match one or more decimal digits.| |`\.?`|Match zero or one occurrence of a period (used as a decimal separator character).| |`((?<=\.)\d+)?`|If a period is the previous character, match one or more decimal digits. This pattern can be matched either zero or one time.| -|`(\d+\.?((?<=\.)\d+)?)`|Match the pattern of one or more decimal digits followed by an optional period and additional decimal digits. This is the second capturing group. The call to the method replaces the entire match with the value of this captured group.| +|`(\d+\.?((?<=\.)\d+)?)`|Match the pattern of one or more decimal digits followed by an optional period and additional decimal digits. This is the second capturing group. The call to the method replaces the entire match with the value of this captured group.| |(?(1)|\s?\p{Sc})?|If the first captured group exists, match an empty string. Otherwise, match zero or one white-space character followed by a currency symbol.| ]]> @@ -3571,7 +3571,7 @@ Allows an to attempt to free resources and perfor method is useful for replacing a regular expression match if any of the following conditions is true: + The method is useful for replacing a regular expression match if any of the following conditions is true: - The replacement string cannot readily be specified by a regular expression replacement pattern. @@ -3579,7 +3579,7 @@ Allows an to attempt to free resources and perfor - The replacement string results from conditional processing. - The method is equivalent to calling the method and passing each object in the returned collection to the `evaluator` delegate. + The method is equivalent to calling the method and passing each object in the returned collection to the `evaluator` delegate. The regular expression is the pattern defined by the constructor for the current object. @@ -3590,7 +3590,7 @@ Allows an to attempt to free resources and perfor Your custom method returns a string that replaces the matched input. - The exception is thrown if the execution time of the replacement operation exceeds the time-out interval specified by the constructor. If you do not set a time-out interval when you call the constructor, the exception is thrown if the operation exceeds any time-out value established for the application domain in which the object is created. If no time-out is defined in the constructor call or in the application domain's properties, or if the time-out value is , no exception is thrown + The exception is thrown if the execution time of the replacement operation exceeds the time-out interval specified by the constructor. If you do not set a time-out interval when you call the constructor, the exception is thrown if the operation exceeds any time-out value established for the application domain in which the object is created. If no time-out is defined in the constructor call or in the application domain's properties, or if the time-out value is , no exception is thrown Because the method returns `input` unchanged if there is no match, you can use the method to determine whether the method has made any replacements to the input string. @@ -3668,7 +3668,7 @@ Allows an to attempt to free resources and perfor > [!NOTE] > Substitutions are the only regular expression language elements that are recognized in a replacement pattern. All other regular expression language elements, including [character escapes](/dotnet/standard/base-types/character-escapes-in-regular-expressions), are allowed in regular expression patterns only and are not recognized in replacement patterns. - The exception is thrown if the execution time of the replacement operation exceeds the time-out interval specified by the constructor. If you do not set a time-out interval when you call the constructor, the exception is thrown if the operation exceeds any time-out value established for the application domain in which the object is created. If no time-out is defined in the constructor call or in the application domain's properties, or if the time-out value is , no exception is thrown + The exception is thrown if the execution time of the replacement operation exceeds the time-out interval specified by the constructor. If you do not set a time-out interval when you call the constructor, the exception is thrown if the operation exceeds any time-out value established for the application domain in which the object is created. If no time-out is defined in the constructor call or in the application domain's properties, or if the time-out value is , no exception is thrown Because the method returns `input` unchanged if there is no match, you can use the method to determine whether the method has made any replacements to the input string. @@ -3759,7 +3759,7 @@ Allows an to attempt to free resources and perfor :::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.text.regularexpressions.regex.replace/cs/replaceexample6.cs" interactive="try-dotnet" id="Snippet6"::: :::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.text.regularexpressions.regex.replace/vb/replaceexample6.vb" id="Snippet6"::: - The following example uses the method to replace the local machine and drive names in a UNC path with a local file path. The regular expression uses the property to include the name of the local computer, and the method to include the names of the logical drives. To run the example successfully, you should replace the literal string "MyMachine" with your local machine name. + The following example uses the method to replace the local machine and drive names in a UNC path with a local file path. The regular expression uses the property to include the name of the local computer, and the method to include the names of the logical drives. To run the example successfully, you should replace the literal string "MyMachine" with your local machine name. :::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.text.regularexpressions.regex.replace/cs/replace3.cs" interactive="try-dotnet" id="Snippet3"::: :::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.text.regularexpressions.regex.replace/vb/replace3.vb" id="Snippet3"::: @@ -3843,7 +3843,7 @@ Allows an to attempt to free resources and perfor method is useful for replacing a regular expression match if any of the following conditions is true: + The method is useful for replacing a regular expression match if any of the following conditions is true: - The replacement string cannot readily be specified by a regular expression replacement pattern. @@ -3851,7 +3851,7 @@ Allows an to attempt to free resources and perfor - The replacement string results from conditional processing. - The method is equivalent to calling the method and passing each object in the returned collection to the `evaluator` delegate. + The method is equivalent to calling the method and passing each object in the returned collection to the `evaluator` delegate. The `pattern` parameter consists of regular expression language elements that symbolically describe the string to match. For more information about regular expressions, see [.NET Framework Regular Expressions](/dotnet/standard/base-types/regular-expressions) and [Regular Expression Language - Quick Reference](/dotnet/standard/base-types/regular-expression-language-quick-reference). @@ -3869,7 +3869,7 @@ Allows an to attempt to free resources and perfor ## Examples - The following example uses a regular expression to extract the individual words from a string, and then uses a delegate to call a method named `WordScramble` that scrambles the individual letters in the word. To do this, the `WordScramble` method creates an array that contains the characters in the match. It also creates a parallel array that it populates with random floating-point numbers. The arrays are sorted by calling the method, and the sorted array is provided as an argument to a class constructor. This newly created string is then returned by the `WordScramble` method. The regular expression pattern `\w+` matches one or more word characters; the regular expression engine will continue to add characters to the match until it encounters a non-word character, such as a white-space character. + The following example uses a regular expression to extract the individual words from a string, and then uses a delegate to call a method named `WordScramble` that scrambles the individual letters in the word. To do this, the `WordScramble` method creates an array that contains the characters in the match. It also creates a parallel array that it populates with random floating-point numbers. The arrays are sorted by calling the method, and the sorted array is provided as an argument to a class constructor. This newly created string is then returned by the `WordScramble` method. The regular expression pattern `\w+` matches one or more word characters; the regular expression engine will continue to add characters to the match until it encounters a non-word character, such as a white-space character. :::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.text.regularexpressions.regex.replace/cs/replace5.cs" interactive="try-dotnet" id="Snippet2"::: :::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.text.regularexpressions.regex.replace/vb/replace5.vb" id="Snippet2"::: @@ -3937,7 +3937,7 @@ Allows an to attempt to free resources and perfor method is useful for replacing a regular expression match if any of the following conditions is true: + The method is useful for replacing a regular expression match if any of the following conditions is true: - The replacement string cannot readily be specified by a regular expression replacement pattern. @@ -3945,7 +3945,7 @@ Allows an to attempt to free resources and perfor - The replacement string results from conditional processing. - The method is equivalent to calling the method and passing the first `count` objects in the returned collection to the `evaluator` delegate. + The method is equivalent to calling the method and passing the first `count` objects in the returned collection to the `evaluator` delegate. The regular expression is the pattern defined by the constructor for the current object. @@ -3956,14 +3956,14 @@ Allows an to attempt to free resources and perfor Your custom method returns a string that replaces the matched input. - The exception is thrown if the execution time of the replacement operation exceeds the time-out interval specified by the constructor. If you do not set a time-out interval when you call the constructor, the exception is thrown if the operation exceeds any time-out value established for the application domain in which the object is created. If no time-out is defined in the constructor call or in the application domain's properties, or if the time-out value is , no exception is thrown + The exception is thrown if the execution time of the replacement operation exceeds the time-out interval specified by the constructor. If you do not set a time-out interval when you call the constructor, the exception is thrown if the operation exceeds any time-out value established for the application domain in which the object is created. If no time-out is defined in the constructor call or in the application domain's properties, or if the time-out value is , no exception is thrown Because the method returns `input` unchanged if there is no match, you can use the method to determine whether the method has made any replacements to the input string. ## Examples - The following example uses a regular expression to deliberately misspell half of the words in a list. It uses the regular expression `\w*(ie|ei)\w*` to match words that include the characters "ie" or "ei". It passes the first half of the matching words to the `ReverseLetter` method, which, in turn, uses the method to reverse "i" and "e" in the matched string. The remaining words remain unchanged. + The following example uses a regular expression to deliberately misspell half of the words in a list. It uses the regular expression `\w*(ie|ei)\w*` to match words that include the characters "ie" or "ei". It passes the first half of the matching words to the `ReverseLetter` method, which, in turn, uses the method to reverse "i" and "e" in the matched string. The remaining words remain unchanged. :::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.text.regularexpressions.regex.replace/cs/replace7.cs" interactive="try-dotnet" id="Snippet11"::: :::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.text.regularexpressions.regex.replace/vb/replace7.vb" id="Snippet11"::: @@ -3976,7 +3976,7 @@ Allows an to attempt to free resources and perfor |(ie|ei)|Match either "ie" or "ei".| |`\w*`|Match zero or more word characters.| - The regular expression pattern `([ie])([ie])` in the `ReverseLetter` method matches the first "i" or "e" in the diphthong "ie" or "ei" and assigns the letter to the first capturing group. It matches the second "i" or "e" and assigns the letter to the second capturing group. The two characters are then reversed by calling the method with the replacement pattern `$2$1`. + The regular expression pattern `([ie])([ie])` in the `ReverseLetter` method matches the first "i" or "e" in the diphthong "ie" or "ei" and assigns the letter to the first capturing group. It matches the second "i" or "e" and assigns the letter to the second capturing group. The two characters are then reversed by calling the method with the replacement pattern `$2$1`. ]]> @@ -4046,14 +4046,14 @@ Allows an to attempt to free resources and perfor > [!NOTE] > Substitutions are the only regular expression language elements that are recognized in a replacement pattern. All other regular expression language elements, including [character escapes](/dotnet/standard/base-types/character-escapes-in-regular-expressions), are allowed in regular expression patterns only and are not recognized in replacement patterns. - The exception is thrown if the execution time of the replacement operation exceeds the time-out interval specified by the constructor. If you do not set a time-out interval when you call the constructor, the exception is thrown if the operation exceeds any time-out value established for the application domain in which the object is created. If no time-out is defined in the constructor call or in the application domain's properties, or if the time-out value is , no exception is thrown + The exception is thrown if the execution time of the replacement operation exceeds the time-out interval specified by the constructor. If you do not set a time-out interval when you call the constructor, the exception is thrown if the operation exceeds any time-out value established for the application domain in which the object is created. If no time-out is defined in the constructor call or in the application domain's properties, or if the time-out value is , no exception is thrown Because the method returns `input` unchanged if there is no match, you can use the method to determine whether the method has made any replacements to the input string. ## Examples - The following example double-spaces all but the first line of a string. It defines a regular expression pattern, `^.*$`, that matches a line of text, calls the method to match the first line of the string, and uses the `Match.Index` and `Match.Count` properties to determine the starting position of the second line. + The following example double-spaces all but the first line of a string. It defines a regular expression pattern, `^.*$`, that matches a line of text, calls the method to match the first line of the string, and uses the `Match.Index` and `Match.Count` properties to determine the starting position of the second line. :::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.text.regularexpressions.regex.replace/cs/replaceexample9.cs" interactive="try-dotnet" id="Snippet9"::: :::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.text.regularexpressions.regex.replace/vb/replaceexample9.vb" id="Snippet9"::: @@ -4146,7 +4146,7 @@ Allows an to attempt to free resources and perfor ## Examples - The following example uses the method to replace the local machine and drive names in a UNC path with a local file path. The regular expression uses the property to include the name of the local computer, and the method to include the names of the logical drives. All regular expression string comparisons are case-insensitive. To run the example successfully, you should replace the literal string "MyMachine" with your local machine name. + The following example uses the method to replace the local machine and drive names in a UNC path with a local file path. The regular expression uses the property to include the name of the local computer, and the method to include the names of the logical drives. All regular expression string comparisons are case-insensitive. To run the example successfully, you should replace the literal string "MyMachine" with your local machine name. :::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.text.regularexpressions.regex.replace/cs/replace4.cs" interactive="try-dotnet" id="Snippet4"::: :::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.text.regularexpressions.regex.replace/vb/replace4.vb" id="Snippet4"::: @@ -4235,7 +4235,7 @@ Allows an to attempt to free resources and perfor method is useful for replacing a regular expression match in if any of the following conditions is true: + The method is useful for replacing a regular expression match in if any of the following conditions is true: - The replacement string cannot readily be specified by a regular expression replacement pattern. @@ -4243,7 +4243,7 @@ Allows an to attempt to free resources and perfor - The replacement string results from conditional processing. - The method is equivalent to calling the method and passing each object in the returned collection to the `evaluator` delegate. + The method is equivalent to calling the method and passing each object in the returned collection to the `evaluator` delegate. The `pattern` parameter consists of regular expression language elements that symbolically describe the string to match. For more information about regular expressions, see [.NET Framework Regular Expressions](/dotnet/standard/base-types/regular-expressions) and [Regular Expression Language - Quick Reference](/dotnet/standard/base-types/regular-expression-language-quick-reference). @@ -4263,7 +4263,7 @@ Allows an to attempt to free resources and perfor ## Examples - The following example uses a regular expression to extract the individual words from a string, and then uses a delegate to call a method named `WordScramble` that scrambles the individual letters in the word. To do this, the `WordScramble` method creates an array that contains the characters in the match. It also creates a parallel array that it populates with random floating-point numbers. The arrays are sorted by calling the method, and the sorted array is provided as an argument to a class constructor. This newly created string is then returned by the `WordScramble` method. The regular expression pattern `\w+` matches one or more word characters; the regular expression engine will continue to add characters to the match until it encounters a non-word character, such as a white-space character. The call to the method includes the option so that the comment in the regular expression pattern `\w+ # Matches all the characters in a word.` is ignored by the regular expression engine. + The following example uses a regular expression to extract the individual words from a string, and then uses a delegate to call a method named `WordScramble` that scrambles the individual letters in the word. To do this, the `WordScramble` method creates an array that contains the characters in the match. It also creates a parallel array that it populates with random floating-point numbers. The arrays are sorted by calling the method, and the sorted array is provided as an argument to a class constructor. This newly created string is then returned by the `WordScramble` method. The regular expression pattern `\w+` matches one or more word characters; the regular expression engine will continue to add characters to the match until it encounters a non-word character, such as a white-space character. The call to the method includes the option so that the comment in the regular expression pattern `\w+ # Matches all the characters in a word.` is ignored by the regular expression engine. :::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.text.regularexpressions.regex.replace/cs/replace6.cs" interactive="try-dotnet" id="Snippet10"::: :::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.text.regularexpressions.regex.replace/vb/replace6.vb" id="Snippet10"::: @@ -4333,7 +4333,7 @@ Allows an to attempt to free resources and perfor method is useful for replacing a regular expression match if any of the following conditions is true: + The method is useful for replacing a regular expression match if any of the following conditions is true: - The replacement string cannot readily be specified by a regular expression replacement pattern. @@ -4341,7 +4341,7 @@ Allows an to attempt to free resources and perfor - The replacement string results from conditional processing. - The method is equivalent to calling the method and passing the first `count` objects in the returned collection to the `evaluator` delegate. + The method is equivalent to calling the method and passing the first `count` objects in the returned collection to the `evaluator` delegate. The regular expression is the pattern defined by the constructor for the current object. @@ -4352,7 +4352,7 @@ Allows an to attempt to free resources and perfor Your custom method returns a string that replaces the matched input. - The exception is thrown if the execution time of the replacement operation exceeds the time-out interval specified by the constructor. If you do not set a time-out interval when you call the constructor, the exception is thrown if the operation exceeds any time-out value established for the application domain in which the object is created. If no time-out is defined in the constructor call or in the application domain's properties, or if the time-out value is , no exception is thrown + The exception is thrown if the execution time of the replacement operation exceeds the time-out interval specified by the constructor. If you do not set a time-out interval when you call the constructor, the exception is thrown if the operation exceeds any time-out value established for the application domain in which the object is created. If no time-out is defined in the constructor call or in the application domain's properties, or if the time-out value is , no exception is thrown Because the method returns `input` unchanged if there is no match, you can use the method to determine whether the method has made any replacements to the input string. @@ -4435,7 +4435,7 @@ Allows an to attempt to free resources and perfor ## Examples - The following example uses the method to replace the local machine and drive names in a UNC path with a local file path. The regular expression uses the property to include the name of the local computer and the method to include the names of the logical drives. All regular expression string comparisons are case-insensitive, and any single replacement operation times out if a match cannot be found in 0.5 second. To run the example successfully, you should replace the literal string "MyMachine" with your local machine name. + The following example uses the method to replace the local machine and drive names in a UNC path with a local file path. The regular expression uses the property to include the name of the local computer and the method to include the names of the logical drives. All regular expression string comparisons are case-insensitive, and any single replacement operation times out if a match cannot be found in 0.5 second. To run the example successfully, you should replace the literal string "MyMachine" with your local machine name. :::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.text.regularexpressions.regex.replace/cs/replace12.cs" interactive="try-dotnet" id="Snippet12"::: :::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.text.regularexpressions.regex.replace/vb/replace12.vb" id="Snippet12"::: @@ -4536,7 +4536,7 @@ Allows an to attempt to free resources and perfor method is useful for replacing a regular expression match if any of the following conditions is true: + The method is useful for replacing a regular expression match if any of the following conditions is true: - If the replacement string cannot readily be specified by a regular expression replacement pattern. @@ -4544,7 +4544,7 @@ Allows an to attempt to free resources and perfor - If the replacement string results from conditional processing. - The method is equivalent to calling the method and passing each object in the returned collection to the `evaluator` delegate. + The method is equivalent to calling the method and passing each object in the returned collection to the `evaluator` delegate. The `pattern` parameter consists of regular expression language elements that symbolically describe the string to match. For more information about regular expressions, see [.NET Framework Regular Expressions](/dotnet/standard/base-types/regular-expressions) and [Regular Expression Language - Quick Reference](/dotnet/standard/base-types/regular-expression-language-quick-reference). @@ -4564,7 +4564,7 @@ Allows an to attempt to free resources and perfor ## Examples - The following example uses a regular expression to extract the individual words from a string, and then uses a delegate to call a method named `WordScramble` that scrambles the individual letters in the word. To do this, the `WordScramble` method creates an array that contains the characters in the match. It also creates a parallel array that it populates with random floating-point numbers. The arrays are sorted by calling the method, and the sorted array is provided as an argument to a class constructor. This newly created string is then returned by the `WordScramble` method. The regular expression pattern `\w+` matches one or more word characters; the regular expression engine will continue to add characters to the match until it encounters a non-word character, such as a white-space character. The call to the method includes the option so that the comment in the regular expression pattern `\w+ # Matches all the characters in a word.` is ignored by the regular expression engine. + The following example uses a regular expression to extract the individual words from a string, and then uses a delegate to call a method named `WordScramble` that scrambles the individual letters in the word. To do this, the `WordScramble` method creates an array that contains the characters in the match. It also creates a parallel array that it populates with random floating-point numbers. The arrays are sorted by calling the method, and the sorted array is provided as an argument to a class constructor. This newly created string is then returned by the `WordScramble` method. The regular expression pattern `\w+` matches one or more word characters; the regular expression engine will continue to add characters to the match until it encounters a non-word character, such as a white-space character. The call to the method includes the option so that the comment in the regular expression pattern `\w+ # Matches all the characters in a word.` is ignored by the regular expression engine. :::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.text.regularexpressions.regex.replace/cs/replace13.cs" interactive="try-dotnet" id="Snippet13"::: :::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.text.regularexpressions.regex.replace/vb/replace13.vb" id="Snippet13"::: @@ -4747,7 +4747,7 @@ Allows an to attempt to free resources and perfor methods are similar to the method, except that splits the string at a delimiter determined by a regular expression instead of a set of characters. The string is split as many times as possible. If no delimiter is found, the return value contains one element whose value is the original input string. + The methods are similar to the method, except that splits the string at a delimiter determined by a regular expression instead of a set of characters. The string is split as many times as possible. If no delimiter is found, the return value contains one element whose value is the original input string. If multiple matches are adjacent to one another, an empty string is inserted into the array. For example, splitting a string on a single hyphen causes the returned array to include an empty string in the position where two adjacent hyphens are found, as the following code shows. @@ -4769,14 +4769,14 @@ Allows an to attempt to free resources and perfor :::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Text.RegularExpressions.Regex.Split/cs/split3.cs" interactive="try-dotnet" id="Snippet3"::: :::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Text.RegularExpressions.Regex.Split/vb/split3.vb" id="Snippet3"::: - If the regular expression can match the empty string, will split the string into an array of single-character strings because the empty string delimiter can be found at every location. For example: + If the regular expression can match the empty string, will split the string into an array of single-character strings because the empty string delimiter can be found at every location. For example: :::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Text.RegularExpressions.Regex.Split/cs/split11.cs" interactive="try-dotnet" id="Snippet11"::: :::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Text.RegularExpressions.Regex.Split/vb/split11.vb" id="Snippet11"::: Note that the returned array also includes an empty string at the beginning and end of the array. - The exception is thrown if the execution time of the split operation exceeds the time-out interval specified by the constructor. If you do not set a time-out interval when you call the constructor, the exception is thrown if the operation exceeds any time-out value established for the application domain in which the object is created. If no time-out is defined in the constructor call or in the application domain's properties, or if the time-out value is , no exception is thrown + The exception is thrown if the execution time of the split operation exceeds the time-out interval specified by the constructor. If you do not set a time-out interval when you call the constructor, the exception is thrown if the operation exceeds any time-out value established for the application domain in which the object is created. If no time-out is defined in the constructor call or in the application domain's properties, or if the time-out value is , no exception is thrown ]]> @@ -4845,16 +4845,16 @@ Allows an to attempt to free resources and perfor :::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Text.RegularExpressions.Regex.Split/cs/split4.cs" interactive="try-dotnet" id="Snippet4"::: :::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Text.RegularExpressions.Regex.Split/vb/split4.vb" id="Snippet4"::: - However, when the regular expression pattern includes multiple sets of capturing parentheses, the behavior of this method depends on the version of the .NET Framework. In the .NET Framework 1.0 and 1.1, only captured text from the first set of capturing parentheses is included in the returned array. Starting with the .NET Framework 2.0, all captured text is added to the returned array. However, elements in the returned array that contain captured text are not counted in determining whether the number of matched substrings equals `count`. For example, in the following code, a regular expression uses two sets of capturing parentheses to extract the elements of a date from a date string. The first set of capturing parentheses captures the hyphen, and the second set captures the forward slash. The call to the method then specifies a maximum of two elements in the returned array. If the example code is compiled and run under the .NET Framework 1.0 or 1.1, the method returns a two-element string array. If it is compiled and run under the .NET Framework 2.0 or later versions, the method returns a three-element string array. + However, when the regular expression pattern includes multiple sets of capturing parentheses, the behavior of this method depends on the version of the .NET Framework. In the .NET Framework 1.0 and 1.1, only captured text from the first set of capturing parentheses is included in the returned array. Starting with the .NET Framework 2.0, all captured text is added to the returned array. However, elements in the returned array that contain captured text are not counted in determining whether the number of matched substrings equals `count`. For example, in the following code, a regular expression uses two sets of capturing parentheses to extract the elements of a date from a date string. The first set of capturing parentheses captures the hyphen, and the second set captures the forward slash. The call to the method then specifies a maximum of two elements in the returned array. If the example code is compiled and run under the .NET Framework 1.0 or 1.1, the method returns a two-element string array. If it is compiled and run under the .NET Framework 2.0 or later versions, the method returns a three-element string array. :::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Text.RegularExpressions.Regex.Split/cs/split5.cs" interactive="try-dotnet" id="Snippet5"::: :::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Text.RegularExpressions.Regex.Split/vb/split5.vb" id="Snippet5"::: - If the regular expression can match the empty string, will split the string into an array of single-character strings because the empty string delimiter can be found at every location. The following example splits the string "characters" into as many elements as there are in the input string. Because the null string matches the beginning of the input string, a null string is inserted at the beginning of the returned array. This causes the tenth element to consist of the two characters at the end of the input string. + If the regular expression can match the empty string, will split the string into an array of single-character strings because the empty string delimiter can be found at every location. The following example splits the string "characters" into as many elements as there are in the input string. Because the null string matches the beginning of the input string, a null string is inserted at the beginning of the returned array. This causes the tenth element to consist of the two characters at the end of the input string. :::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Text.RegularExpressions.Regex.Split/vb/split12.vb" id="Snippet12"::: - The exception is thrown if the execution time of the split operation exceeds the time-out interval specified by the constructor. If you do not set a time-out interval when you call the constructor, the exception is thrown if the operation exceeds any time-out value established for the application domain in which the object is created. If no time-out is defined in the constructor call or in the application domain's properties, or if the time-out value is , no exception is thrown + The exception is thrown if the execution time of the split operation exceeds the time-out interval specified by the constructor. If you do not set a time-out interval when you call the constructor, the exception is thrown if the operation exceeds any time-out value established for the application domain in which the object is created. If no time-out is defined in the constructor call or in the application domain's properties, or if the time-out value is , no exception is thrown ]]> @@ -5032,7 +5032,7 @@ Allows an to attempt to free resources and perfor :::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Text.RegularExpressions.Regex.Split/cs/split14.cs" interactive="try-dotnet" id="Snippet14"::: :::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Text.RegularExpressions.Regex.Split/vb/split14.vb" id="Snippet14"::: - The exception is thrown if the execution time of the split operation exceeds the time-out interval specified by the constructor. If you do not set a time-out interval when you call the constructor, the exception is thrown if the operation exceeds any time-out value established for the application domain in which the object is created. If no time-out is defined in the constructor call or in the application domain's properties, or if the time-out value is , no exception is thrown + The exception is thrown if the execution time of the split operation exceeds the time-out interval specified by the constructor. If you do not set a time-out interval when you call the constructor, the exception is thrown if the operation exceeds any time-out value established for the application domain in which the object is created. If no time-out is defined in the constructor call or in the application domain's properties, or if the time-out value is , no exception is thrown ]]> @@ -5093,7 +5093,7 @@ Allows an to attempt to free resources and perfor methods are similar to the method, except that splits the string at a delimiter determined by a regular expression instead of a set of characters. The string is split as many times as possible. If no delimiter is found, the return value contains one element whose value is the original `input` string. + The methods are similar to the method, except that splits the string at a delimiter determined by a regular expression instead of a set of characters. The string is split as many times as possible. If no delimiter is found, the return value contains one element whose value is the original `input` string. The `pattern` parameter consists of regular expression language elements that symbolically describe the string to match. For more information about regular expressions, see [.NET Framework Regular Expressions](/dotnet/standard/base-types/regular-expressions) and [Regular Expression Language - Quick Reference](/dotnet/standard/base-types/regular-expression-language-quick-reference). @@ -5184,7 +5184,7 @@ Allows an to attempt to free resources and perfor methods are similar to the method, except that splits the string at a delimiter determined by a regular expression instead of a set of characters. The string is split as many times as possible. If no delimiter is found, the return value contains one element whose value is the original `input` string. + The methods are similar to the method, except that splits the string at a delimiter determined by a regular expression instead of a set of characters. The string is split as many times as possible. If no delimiter is found, the return value contains one element whose value is the original `input` string. The `pattern` parameter consists of regular expression language elements that symbolically describe the string to match. For more information about regular expressions, see [.NET Framework Regular Expressions](/dotnet/standard/base-types/regular-expressions) and [Regular Expression Language - Quick Reference](/dotnet/standard/base-types/regular-expression-language-quick-reference). diff --git a/xml/System.Threading.Tasks.Dataflow/BatchBlock`1.xml b/xml/System.Threading.Tasks.Dataflow/BatchBlock`1.xml index 92eba3b0964..f55eea1e4a6 100644 --- a/xml/System.Threading.Tasks.Dataflow/BatchBlock`1.xml +++ b/xml/System.Threading.Tasks.Dataflow/BatchBlock`1.xml @@ -398,7 +398,7 @@ instances linked to this [ISourceBlock(T\ instance may use [ISourceBlock(T\ , and it must only be used to consume [ISourceBlock(T\ instances previously offered by this source to the target. + Only instances linked to this instance may use , and it must only be used to consume instances previously offered by this source to the target. ]]> @@ -443,7 +443,7 @@ instances linked to this [ISourceBlock(T\ instance may use `ReleaseReservation`, and it must only be used to release [ISourceBlock(T\ instances previously and successfully reserved by the target. + Only instances linked to this instance may use `ReleaseReservation`, and it must only be used to release instances previously and successfully reserved by the target. ]]> @@ -491,11 +491,11 @@ instances linked to this [ISourceBlock(T\ instance may use [ISourceBlock(T\, and it must only be used to reserve [ISourceBlock(T\ instances previously offered by this source to the target. + Only instances linked to this instance may use , and it must only be used to reserve instances previously offered by this source to the target. - If `true` is returned, the [ISourceBlock(T\ must subsequently call either [ISourceBlock(T\ or [ISourceBlock(T\ for this message. Failure to do so may result in the source being unable to propagate any further messages to this or other targets. + If `true` is returned, the must subsequently call either or for this message. Failure to do so may result in the source being unable to propagate any further messages to this or other targets. - [ISourceBlock(T\ must not be called while the target is holding any internal locks. Doing so will violate the lock hierarchy necessary to avoid deadlocks in a dataflow network. + must not be called while the target is holding any internal locks. Doing so will violate the lock hierarchy necessary to avoid deadlocks in a dataflow network. ]]> diff --git a/xml/System.Windows.Forms/Application.xml b/xml/System.Windows.Forms/Application.xml index a7f1e5673e6..8bda6c433f0 100644 --- a/xml/System.Windows.Forms/Application.xml +++ b/xml/System.Windows.Forms/Application.xml @@ -247,7 +247,7 @@ ## Remarks If the key does not exist, it is created in the following format: - LocalMachine\Software\\\\\\ + LocalMachine\Software\\\\\\ ]]> diff --git a/xml/System.Xml.Serialization/XmlSerializer.xml b/xml/System.Xml.Serialization/XmlSerializer.xml index 18bfdce1771..847cd21a2e4 100644 --- a/xml/System.Xml.Serialization/XmlSerializer.xml +++ b/xml/System.Xml.Serialization/XmlSerializer.xml @@ -749,15 +749,13 @@ xmlSerializer mySerializer=new XmlSerializer(typeof(LargeNumbers)); that serializes a class that extends or overrides the behavior of a base class. For example, given a DLL, it is possible to create a class that inherits or extends a class contained in the DLL. To serialize such a class, you must use an instance of the [XmlSerializer Constructor (Type, XmlAttributeOverrides, Type\ class when constructing the [XmlSerializer Constructor (Type, XmlAttributeOverrides, Type\. For more details, see [XmlSerializer Constructor (Type, XmlAttributeOverrides, Type\. + The `overrides` parameter allows for the creation of an that serializes a class that extends or overrides the behavior of a base class. For example, given a DLL, it is possible to create a class that inherits or extends a class contained in the DLL. To serialize such a class, you must use an instance of the class when constructing the . For more details, see . - By default, if a public property or field returns an object, or array of objects, the object types are automatically serialized. However, if a class contains a field or property that returns an array of type [XmlSerializer Constructor (Type, XmlAttributeOverrides, Type\, any object can be inserted into that array. In that case, the [XmlSerializer Constructor (Type, XmlAttributeOverrides, Type\ must be instructed to expect all the possible object types that are inserted into the [XmlSerializer Constructor (Type, XmlAttributeOverrides, Type\ array. To do this, use the `extraTypes` parameter to specify the extra object types to serialize or deserialize. - - The root element of an XML document encloses all the other elements. By default, the object specified by the `type` parameter is serialized as the root element. Properties, such as the XML element name of the root element are taken from the `type` object. However, the `root` parameter allows you to replace the default object's information by specifying an [XmlSerializer Constructor (Type, XmlAttributeOverrides, Type\; the object allows you to set a different namespace, element name, and so on. + By default, if a public property or field returns an object, or array of objects, the object types are automatically serialized. However, if a class contains a field or property that returns an array of type , any object can be inserted into that array. In that case, the must be instructed to expect all the possible object types that are inserted into the array. To do this, use the `extraTypes` parameter to specify the extra object types to serialize or deserialize. - Use the `defaultName` parameter to specify the default namespace of all XML elements generated by the [XmlSerializer Constructor (Type, XmlAttributeOverrides, Type\. + The root element of an XML document encloses all the other elements. By default, the object specified by the `type` parameter is serialized as the root element. Properties, such as the XML element name of the root element are taken from the `type` object. However, the `root` parameter allows you to replace the default object's information by specifying an ; the object allows you to set a different namespace, element name, and so on. - + Use the `defaultName` parameter to specify the default namespace of all XML elements generated by the . ## Examples The following example serializes an instance of a class that is defined in a DLL and to do so, overrides the public members found in the class. The example also specifies an array of extra types, the default namespace for all XML elements, and the class to use that provides the XML root element information. The example assumes that the code at the beginning has been compiled into a DLL named `HighSchool`. diff --git a/xml/System/Array.xml b/xml/System/Array.xml index 1f3a52dd920..d9ab053cb08 100644 --- a/xml/System/Array.xml +++ b/xml/System/Array.xml @@ -707,14 +707,14 @@ ## Examples - The following code example demonstrates the generic method overload and the generic method overload. An array of strings is created, in no particular order. + The following code example demonstrates the generic method overload and the generic method overload. An array of strings is created, in no particular order. The array is displayed, sorted, and displayed again. Arrays must be sorted in order to use the method. > [!NOTE] > The calls to the and generic methods do not look any different from calls to their nongeneric counterparts, because Visual Basic, C#, and C++ infer the type of the generic type parameter from the type of the first argument. If you use the [Ildasm.exe (IL Disassembler)](/dotnet/framework/tools/ildasm-exe-il-disassembler) to examine the Microsoft intermediate language (MSIL), you can see that the generic methods are being called. - The generic method overload is then used to search for two strings, one that is not in the array and one that is. The array and the return value of the method are passed to the `ShowWhere` generic method, which displays the index value if the string is found, and otherwise the elements the search string would fall between if it were in the array. The index is negative if the string is not in the array, so the `ShowWhere` method takes the bitwise complement (the ~ operator in C# and Visual C++, `Xor`-1 in Visual Basic) to obtain the index of the first element in the list that is larger than the search string. + The generic method overload is then used to search for two strings, one that is not in the array and one that is. The array and the return value of the method are passed to the `ShowWhere` generic method, which displays the index value if the string is found, and otherwise the elements the search string would fall between if it were in the array. The index is negative if the string is not in the array, so the `ShowWhere` method takes the bitwise complement (the ~ operator in C# and Visual C++, `Xor`-1 in Visual Basic) to obtain the index of the first element in the list that is larger than the search string. [!code-cpp[Array_SortSearch#1](~/samples/snippets/cpp/VS_Snippets_CLR/Array_SortSearch/cpp/source.cpp#1)] [!code-csharp[Array_SortSearch#1](~/samples/snippets/csharp/VS_Snippets_CLR/Array_SortSearch/cs/source.cs#1)] @@ -819,16 +819,16 @@ ## Examples - The following example demonstrates the generic method overload and the generic method overload. + The following example demonstrates the generic method overload and the generic method overload. - The code example defines an alternative comparer for strings, named `ReverseCompare`, which implements the `IComparer` (`IComparer(Of String)` in Visual Basic, `IComparer` in Visual C++) generic interface. The comparer calls the method, reversing the order of the comparands so that the strings sort high-to-low instead of low-to-high. + The code example defines an alternative comparer for strings, named `ReverseCompare`, which implements the `IComparer` (`IComparer(Of String)` in Visual Basic, `IComparer` in Visual C++) generic interface. The comparer calls the method, reversing the order of the comparands so that the strings sort high-to-low instead of low-to-high. The array is displayed, sorted, and displayed again. Arrays must be sorted in order to use the method. > [!NOTE] -> The calls to the and generic methods do not look any different from calls to their nongeneric counterparts, because Visual Basic, C#, and C++ infer the type of the generic type parameter from the type of the first argument. If you use the [Ildasm.exe (IL Disassembler)](/dotnet/framework/tools/ildasm-exe-il-disassembler) to examine the Microsoft intermediate language (MSIL), you can see that the generic methods are being called. +> The calls to the and generic methods do not look any different from calls to their nongeneric counterparts, because Visual Basic, C#, and C++ infer the type of the generic type parameter from the type of the first argument. If you use the [Ildasm.exe (IL Disassembler)](/dotnet/framework/tools/ildasm-exe-il-disassembler) to examine the Microsoft intermediate language (MSIL), you can see that the generic methods are being called. - The generic method overload is then used to search for two strings, one that is not in the array and one that is. The array and the return value of the method are passed to the `ShowWhere` generic method, which displays the index value if the string is found, and otherwise the elements the search string would fall between if it were in the array. The index is negative if the string is not n the array, so the `ShowWhere` method takes the bitwise complement (the ~ operator in C# and Visual C++, `Xor` -1 in Visual Basic) to obtain the index of the first element in the list that is larger than the search string. + The generic method overload is then used to search for two strings, one that is not in the array and one that is. The array and the return value of the method are passed to the `ShowWhere` generic method, which displays the index value if the string is found, and otherwise the elements the search string would fall between if it were in the array. The index is negative if the string is not n the array, so the `ShowWhere` method takes the bitwise complement (the ~ operator in C# and Visual C++, `Xor` -1 in Visual Basic) to obtain the index of the first element in the list that is larger than the search string. [!code-cpp[Array_SortSearchComparer#1](~/samples/snippets/cpp/VS_Snippets_CLR/Array_SortSearchComparer/cpp/source.cpp#1)] [!code-csharp[Array_SortSearchComparer#1](~/samples/snippets/csharp/VS_Snippets_CLR/Array_SortSearchComparer/cs/source.cs#1)] @@ -3191,12 +3191,12 @@ ## Examples The following code example demonstrates all three overloads of the generic method. An array of strings is created, containing 8 dinosaur names, two of which (at positions 1 and 5) end with "saurus". The code example also defines a search predicate method named `EndsWithSaurus`, which accepts a string parameter and returns a Boolean value indicating whether the input string ends in "saurus". - The method overload traverses the array from the beginning, passing each element in turn to the `EndsWithSaurus` method. The search stops when the `EndsWithSaurus` method returns `true` for the element at position 1. + The method overload traverses the array from the beginning, passing each element in turn to the `EndsWithSaurus` method. The search stops when the `EndsWithSaurus` method returns `true` for the element at position 1. > [!NOTE] > In C# and Visual Basic, it is not necessary to create the `Predicate` delegate (`Predicate(Of String)` in Visual Basic) explicitly. These languages infer the correct delegate from context and create it automatically. - The method overload is used to search the array beginning at position 2 and continuing to the end of the array. It finds the element at position 5. Finally, the method overload is used to search the range of three elements beginning at position 2. It returns -1 because there are no dinosaur names in that range that end with "saurus". + The method overload is used to search the array beginning at position 2 and continuing to the end of the array. It finds the element at position 5. Finally, the method overload is used to search the range of three elements beginning at position 2. It returns -1 because there are no dinosaur names in that range that end with "saurus". [!code-cpp[Array_FindIndex#1](~/samples/snippets/cpp/VS_Snippets_CLR/Array_FindIndex/cpp/source.cpp#1)] [!code-csharp[Array_FindIndex#1](~/samples/snippets/csharp/VS_Snippets_CLR/Array_FindIndex/cs/source.cs#1)] @@ -3283,12 +3283,12 @@ ## Examples The following code example demonstrates all three overloads of the generic method. An array of strings is created, containing 8 dinosaur names, two of which (at positions 1 and 5) end with "saurus". The code example also defines a search predicate method named `EndsWithSaurus`, which accepts a string parameter and returns a Boolean value indicating whether the input string ends in "saurus". - The method overload traverses the array from the beginning, passing each element in turn to the `EndsWithSaurus` method. The search stops when the `EndsWithSaurus` method returns `true` for the element at position 1. + The method overload traverses the array from the beginning, passing each element in turn to the `EndsWithSaurus` method. The search stops when the `EndsWithSaurus` method returns `true` for the element at position 1. > [!NOTE] > In C# and Visual Basic, it is not necessary to create the `Predicate` delegate (`Predicate(Of String)` in Visual Basic) explicitly. These languages infer the correct delegate from context and create it automatically. - The method overload is used to search the array beginning at position 2 and continuing to the end of the array. It finds the element at position 5. Finally, the method overload is used to search the range of three elements beginning at position 2. It returns -1 because there are no dinosaur names in that range that end with "saurus". + The method overload is used to search the array beginning at position 2 and continuing to the end of the array. It finds the element at position 5. Finally, the method overload is used to search the range of three elements beginning at position 2. It returns -1 because there are no dinosaur names in that range that end with "saurus". [!code-cpp[Array_FindIndex#1](~/samples/snippets/cpp/VS_Snippets_CLR/Array_FindIndex/cpp/source.cpp#1)] [!code-csharp[Array_FindIndex#1](~/samples/snippets/csharp/VS_Snippets_CLR/Array_FindIndex/cs/source.cs#1)] @@ -3379,12 +3379,12 @@ ## Examples The following code example demonstrates all three overloads of the generic method. An array of strings is created, containing 8 dinosaur names, two of which (at positions 1 and 5) end with "saurus". The code example also defines a search predicate method named `EndsWithSaurus`, which accepts a string parameter and returns a Boolean value indicating whether the input string ends in "saurus". - The method overload traverses the array from the beginning, passing each element in turn to the `EndsWithSaurus` method. The search stops when the `EndsWithSaurus` method returns `true` for the element at position 1. + The method overload traverses the array from the beginning, passing each element in turn to the `EndsWithSaurus` method. The search stops when the `EndsWithSaurus` method returns `true` for the element at position 1. > [!NOTE] > In C# and Visual Basic, it is not necessary to create the `Predicate` delegate (`Predicate(Of String)` in Visual Basic) explicitly. These languages infer the correct delegate from context and create it automatically. - The method overload is used to search the array beginning at position 2 and continuing to the end of the array. It finds the element at position 5. Finally, the method overload is used to search the range of three elements beginning at position 2. It returns -1 because there are no dinosaur names in that range that end with "saurus". + The method overload is used to search the array beginning at position 2 and continuing to the end of the array. It finds the element at position 5. Finally, the method overload is used to search the range of three elements beginning at position 2. It returns -1 because there are no dinosaur names in that range that end with "saurus". [!code-cpp[Array_FindIndex#1](~/samples/snippets/cpp/VS_Snippets_CLR/Array_FindIndex/cpp/source.cpp#1)] [!code-csharp[Array_FindIndex#1](~/samples/snippets/csharp/VS_Snippets_CLR/Array_FindIndex/cs/source.cs#1)] @@ -3581,12 +3581,12 @@ ## Examples The following code example demonstrates all three overloads of the generic method. An array of strings is created, containing 8 dinosaur names, two of which (at positions 1 and 5) end with "saurus". The code example also defines a search predicate method named `EndsWithSaurus`, which accepts a string parameter and returns a Boolean value indicating whether the input string ends in "saurus". - The method overload traverses the array backward from the end, passing each element in turn to the `EndsWithSaurus` method. The search stops when the `EndsWithSaurus` method returns `true` for the element at position 5. + The method overload traverses the array backward from the end, passing each element in turn to the `EndsWithSaurus` method. The search stops when the `EndsWithSaurus` method returns `true` for the element at position 5. > [!NOTE] > In C# and Visual Basic, it is not necessary to create the `Predicate` delegate (`Predicate(Of String)` in Visual Basic) explicitly. These languages infer the correct delegate from context and create it automatically. - The method overload is used to search the array beginning at position 4 and continuing backward to the beginning of the array. It finds the element at position 1. Finally, the method overload is used to search the range of three elements beginning at position 4 and working backward (that is, elements 4, 3, and 2). It returns -1 because there are no dinosaur names in that range that end with "saurus". + The method overload is used to search the array beginning at position 4 and continuing backward to the beginning of the array. It finds the element at position 1. Finally, the method overload is used to search the range of three elements beginning at position 4 and working backward (that is, elements 4, 3, and 2). It returns -1 because there are no dinosaur names in that range that end with "saurus". [!code-cpp[Array_FindLastIndex#1](~/samples/snippets/cpp/VS_Snippets_CLR/Array_FindLastIndex/cpp/source.cpp#1)] [!code-csharp[Array_FindLastIndex#1](~/samples/snippets/csharp/VS_Snippets_CLR/Array_FindLastIndex/cs/source.cs#1)] @@ -3673,12 +3673,12 @@ ## Examples The following code example demonstrates all three overloads of the generic method. An array of strings is created, containing 8 dinosaur names, two of which (at positions 1 and 5) end with "saurus". The code example also defines a search predicate method named `EndsWithSaurus`, which accepts a string parameter and returns a Boolean value indicating whether the input string ends in "saurus". - The method overload traverses the array backward from the end, passing each element in turn to the `EndsWithSaurus` method. The search stops when the `EndsWithSaurus` method returns `true` for the element at position 5. + The method overload traverses the array backward from the end, passing each element in turn to the `EndsWithSaurus` method. The search stops when the `EndsWithSaurus` method returns `true` for the element at position 5. > [!NOTE] > In C# and Visual Basic, it is not necessary to create the `Predicate` delegate (`Predicate(Of String)` in Visual Basic) explicitly. These languages infer the correct delegate from context and create it automatically. - The method overload is used to search the array beginning at position 4 and continuing backward to the beginning of the array. It finds the element at position 1. Finally, the method overload is used to search the range of three elements beginning at position 4 and working backward (that is, elements 4, 3, and 2). It returns -1 because there are no dinosaur names in that range that end with "saurus". + The method overload is used to search the array beginning at position 4 and continuing backward to the beginning of the array. It finds the element at position 1. Finally, the method overload is used to search the range of three elements beginning at position 4 and working backward (that is, elements 4, 3, and 2). It returns -1 because there are no dinosaur names in that range that end with "saurus". [!code-cpp[Array_FindLastIndex#1](~/samples/snippets/cpp/VS_Snippets_CLR/Array_FindLastIndex/cpp/source.cpp#1)] [!code-csharp[Array_FindLastIndex#1](~/samples/snippets/csharp/VS_Snippets_CLR/Array_FindLastIndex/cs/source.cs#1)] @@ -3769,12 +3769,12 @@ ## Examples The following code example demonstrates all three overloads of the generic method. An array of strings is created, containing 8 dinosaur names, two of which (at positions 1 and 5) end with "saurus". The code example also defines a search predicate method named `EndsWithSaurus`, which accepts a string parameter and returns a Boolean value indicating whether the input string ends in "saurus". - The method overload traverses the array backward from the end, passing each element in turn to the `EndsWithSaurus` method. The search stops when the `EndsWithSaurus` method returns `true` for the element at position 5. + The method overload traverses the array backward from the end, passing each element in turn to the `EndsWithSaurus` method. The search stops when the `EndsWithSaurus` method returns `true` for the element at position 5. > [!NOTE] > In C# and Visual Basic, it is not necessary to create the `Predicate` delegate (`Predicate(Of String)` in Visual Basic) explicitly. These languages infer the correct delegate from context and create it automatically. - The method overload is used to search the array beginning at position 4 and continuing backward to the beginning of the array. It finds the element at position 1. Finally, the method overload is used to search the range of three elements beginning at position 4 and working backward (that is, elements 4, 3, and 2). It returns -1 because there are no dinosaur names in that range that end with "saurus". + The method overload is used to search the array beginning at position 4 and continuing backward to the beginning of the array. It finds the element at position 1. Finally, the method overload is used to search the range of three elements beginning at position 4 and working backward (that is, elements 4, 3, and 2). It returns -1 because there are no dinosaur names in that range that end with "saurus". [!code-cpp[Array_FindLastIndex#1](~/samples/snippets/cpp/VS_Snippets_CLR/Array_FindLastIndex/cpp/source.cpp#1)] [!code-csharp[Array_FindLastIndex#1](~/samples/snippets/csharp/VS_Snippets_CLR/Array_FindLastIndex/cs/source.cs#1)] @@ -4156,7 +4156,7 @@ The method always returns a value that indicates the index of the lower bound of the array, even if the array is empty. - Note that, although most arrays in the .NET Framework are zero-based (that is, the method returns zero for each dimension of an array), the .NET Framework does support arrays that are not zero-based. Such arrays can be created with the method, and can also be returned from unmanaged code. + Note that, although most arrays in the .NET Framework are zero-based (that is, the method returns zero for each dimension of an array), the .NET Framework does support arrays that are not zero-based. Such arrays can be created with the method, and can also be returned from unmanaged code. This method is an O(1) operation. @@ -4937,7 +4937,7 @@ method, that override is called. + This method searches all the elements of a one-dimensional array for `value`. To determine whether `value` exists in `array`, the method performs an equality comparison by calling each element's `Equals` method until it finds a match. This means that if the element overrides the method, that override is called. Because most arrays have a lower bound of zero, this method generally returns -1 if`value` isn't found. In the rare case that the lower bound of the array is equal to (0x80000000) and `value` isn't found, this method returns (0x7FFFFFFF). @@ -4948,11 +4948,11 @@ ## Examples The example calls the following three overloads of the method to find the index of a string in a string array: -- , to determine the first occurrence of the string "the" in a string array. +- , to determine the first occurrence of the string "the" in a string array. -- , to determine the first occurrence of the string "the" in the fourth to the last elements of a string array. +- , to determine the first occurrence of the string "the" in the fourth to the last elements of a string array. -- , to determine the first occurrence of the string "the" in a string array from the element that follows the last successful match to the end of the array. +- , to determine the first occurrence of the string "the" in a string array from the element that follows the last successful match to the end of the array. [!code-cpp[Classic Array.IndexOf Example#1](~/samples/snippets/cpp/VS_Snippets_CLR_Classic/classic Array.IndexOf Example/CPP/source.cpp#1)] [!code-csharp-interactive[Classic Array.IndexOf Example#1](~/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Array.IndexOf Example/CS/source.cs#1)] @@ -5023,7 +5023,7 @@ method, that override is called. + This method searches a one-dimensional array from the element at index `startIndex` to the last element. To determine whether `value` exists in `array`, the method performs an equality comparison by calling the `Equals` method of every element until it finds a match. This means that if the element overrides the method, that override is called. Because most arrays have a lower bound of zero, this method generally returns -1 if `value` isn't found. In the rare case that the lower bound of the array is equal to (0x80000000) and `value` isn't found, this method returns (0x7FFFFFFF). @@ -5036,11 +5036,11 @@ ## Examples The example calls the following three overloads of the method to find the index of a string in a string array: -- , to determine the first occurrence of the string "the" in a string array. +- , to determine the first occurrence of the string "the" in a string array. -- , to determine the first occurrence of the string "the" in the fourth to the last elements of a string array. +- , to determine the first occurrence of the string "the" in the fourth to the last elements of a string array. -- , to determine the first occurrence of the string "the" in a string array from the element that follows the last successful match to the end of the array. +- , to determine the first occurrence of the string "the" in a string array from the element that follows the last successful match to the end of the array. [!code-cpp[Classic Array.IndexOf Example#1](~/samples/snippets/cpp/VS_Snippets_CLR_Classic/classic Array.IndexOf Example/CPP/source.cpp#1)] [!code-csharp-interactive[Classic Array.IndexOf Example#1](~/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Array.IndexOf Example/CS/source.cs#1)] @@ -5133,11 +5133,11 @@ ## Examples The example calls the following three overloads of the method to find the index of a string in a string array: -- , to determine the first occurrence of the string "the" in a string array. +- , to determine the first occurrence of the string "the" in a string array. -- , to determine the first occurrence of the string "the" in the fourth to the last elements of a string array. +- , to determine the first occurrence of the string "the" in the fourth to the last elements of a string array. -- , to determine the first occurrence of the string "the" in a string array from the element that follows the last successful match to the end of the array. To determine the value of the `count` argument, it subtracts the upper bound of the array from the starting index and adds one. +- , to determine the first occurrence of the string "the" in a string array from the element that follows the last successful match to the end of the array. To determine the value of the `count` argument, it subtracts the upper bound of the array from the starting index and adds one. [!code-cpp[Classic Array.IndexOf Example#1](~/samples/snippets/cpp/VS_Snippets_CLR_Classic/classic Array.IndexOf Example/CPP/source.cpp#1)] [!code-csharp-interactive[Classic Array.IndexOf Example#1](~/samples/snippets/csharp/VS_Snippets_CLR_Classic/classic Array.IndexOf Example/CS/source.cs#1)] @@ -5220,7 +5220,7 @@ ## Examples - The following example demonstrates all three generic overloads of the method. An array of strings is created, with one entry that appears twice, at index location 0 and index location 5. The method overload searches the array from the beginning, and finds the first occurrence of the string. The method overload is used to search the array beginning with index location 3 and continuing to the end of the array, and finds the second occurrence of the string. Finally, the method overload is used to search a range of two entries, beginning at index location two; it returns -1 because there are no instances of the search string in that range. + The following example demonstrates all three generic overloads of the method. An array of strings is created, with one entry that appears twice, at index location 0 and index location 5. The method overload searches the array from the beginning, and finds the first occurrence of the string. The method overload is used to search the array beginning with index location 3 and continuing to the end of the array, and finds the second occurrence of the string. Finally, the method overload is used to search a range of two entries, beginning at index location two; it returns -1 because there are no instances of the search string in that range. [!code-cpp[Array_IndexOf#1](~/samples/snippets/cpp/VS_Snippets_CLR/Array_IndexOf/cpp/source.cpp#1)] [!code-csharp-interactive[Array_IndexOf#1](~/samples/snippets/csharp/VS_Snippets_CLR/Array_IndexOf/cs/source.cs#1)] @@ -5295,7 +5295,7 @@ ## Examples - The following example demonstrates all three generic overloads of the method. An array of strings is created, with one entry that appears twice, at index location 0 and index location 5. The method overload searches the array from the beginning, and finds the first occurrence of the string. The method overload is used to search the array beginning with index location 3 and continuing to the end of the array, and finds the second occurrence of the string. Finally, the method overload is used to search a range of two entries, beginning at index location two; it returns -1 because there are no instances of the search string in that range. + The following example demonstrates all three generic overloads of the method. An array of strings is created, with one entry that appears twice, at index location 0 and index location 5. The method overload searches the array from the beginning, and finds the first occurrence of the string. The method overload is used to search the array beginning with index location 3 and continuing to the end of the array, and finds the second occurrence of the string. Finally, the method overload is used to search a range of two entries, beginning at index location two; it returns -1 because there are no instances of the search string in that range. [!code-cpp[Array_IndexOf#1](~/samples/snippets/cpp/VS_Snippets_CLR/Array_IndexOf/cpp/source.cpp#1)] [!code-csharp-interactive[Array_IndexOf#1](~/samples/snippets/csharp/VS_Snippets_CLR/Array_IndexOf/cs/source.cs#1)] @@ -5374,7 +5374,7 @@ ## Examples - The following example demonstrates all three generic overloads of the method. An array of strings is created, with one entry that appears twice, at index location 0 and index location 5. The method overload searches the array from the beginning, and finds the first occurrence of the string. The method overload is used to search the array beginning with index location 3 and continuing to the end of the array, and finds the second occurrence of the string. Finally, the method overload is used to search a range of two entries, beginning at index location two; it returns -1 because there are no instances of the search string in that range. + The following example demonstrates all three generic overloads of the method. An array of strings is created, with one entry that appears twice, at index location 0 and index location 5. The method overload searches the array from the beginning, and finds the first occurrence of the string. The method overload is used to search the array beginning with index location 3 and continuing to the end of the array, and finds the second occurrence of the string. Finally, the method overload is used to search a range of two entries, beginning at index location two; it returns -1 because there are no instances of the search string in that range. [!code-cpp[Array_IndexOf#1](~/samples/snippets/cpp/VS_Snippets_CLR/Array_IndexOf/cpp/source.cpp#1)] [!code-csharp-interactive[Array_IndexOf#1](~/samples/snippets/csharp/VS_Snippets_CLR/Array_IndexOf/cs/source.cs#1)] @@ -5988,7 +5988,7 @@ ## Examples - The following code example demonstrates all three generic overloads of the method. An array of strings is created, with one entry that appears twice, at index location 0 and index location 5. The method overload searches the entire array from the end, and finds the second occurrence of the string. The method overload is used to search the array backward beginning with index location 3 and continuing to the beginning of the array, and finds the first occurrence of the string. Finally, the method overload is used to search a range of four entries, beginning at index location 4 and extending backward (that is, it searches the items at locations 4, 3, 2, and 1); this search returns -1 because there are no instances of the search string in that range. + The following code example demonstrates all three generic overloads of the method. An array of strings is created, with one entry that appears twice, at index location 0 and index location 5. The method overload searches the entire array from the end, and finds the second occurrence of the string. The method overload is used to search the array backward beginning with index location 3 and continuing to the beginning of the array, and finds the first occurrence of the string. Finally, the method overload is used to search a range of four entries, beginning at index location 4 and extending backward (that is, it searches the items at locations 4, 3, 2, and 1); this search returns -1 because there are no instances of the search string in that range. [!code-cpp[Array_LastIndexOf#1](~/samples/snippets/cpp/VS_Snippets_CLR/Array_LastIndexOf/cpp/source.cpp#1)] [!code-csharp-interactive[Array_LastIndexOf#1](~/samples/snippets/csharp/VS_Snippets_CLR/Array_LastIndexOf/cs/source.cs#1)] @@ -6063,7 +6063,7 @@ ## Examples - The following code example demonstrates all three generic overloads of the method. An array of strings is created, with one entry that appears twice, at index location 0 and index location 5. The method overload searches the entire array from the end, and finds the second occurrence of the string. The method overload is used to search the array backward beginning with index location 3 and continuing to the beginning of the array, and finds the first occurrence of the string. Finally, the method overload is used to search a range of four entries, beginning at index location 4 and extending backward (that is, it searches the items at locations 4, 3, 2, and 1); this search returns -1 because there are no instances of the search string in that range. + The following code example demonstrates all three generic overloads of the method. An array of strings is created, with one entry that appears twice, at index location 0 and index location 5. The method overload searches the entire array from the end, and finds the second occurrence of the string. The method overload is used to search the array backward beginning with index location 3 and continuing to the beginning of the array, and finds the first occurrence of the string. Finally, the method overload is used to search a range of four entries, beginning at index location 4 and extending backward (that is, it searches the items at locations 4, 3, 2, and 1); this search returns -1 because there are no instances of the search string in that range. [!code-cpp[Array_LastIndexOf#1](~/samples/snippets/cpp/VS_Snippets_CLR/Array_LastIndexOf/cpp/source.cpp#1)] [!code-csharp-interactive[Array_LastIndexOf#1](~/samples/snippets/csharp/VS_Snippets_CLR/Array_LastIndexOf/cs/source.cs#1)] @@ -6142,7 +6142,7 @@ ## Examples - The following code example demonstrates all three generic overloads of the method. An array of strings is created, with one entry that appears twice, at index location 0 and index location 5. The method overload searches the entire array from the end, and finds the second occurrence of the string. The method overload is used to search the array backward beginning with index location 3 and continuing to the beginning of the array, and finds the first occurrence of the string. Finally, the method overload is used to search a range of four entries, beginning at index location 4 and extending backward (that is, it searches the items at locations 4, 3, 2, and 1); this search returns -1 because there are no instances of the search string in that range. + The following code example demonstrates all three generic overloads of the method. An array of strings is created, with one entry that appears twice, at index location 0 and index location 5. The method overload searches the entire array from the end, and finds the second occurrence of the string. The method overload is used to search the array backward beginning with index location 3 and continuing to the beginning of the array, and finds the first occurrence of the string. Finally, the method overload is used to search a range of four entries, beginning at index location 4 and extending backward (that is, it searches the items at locations 4, 3, 2, and 1); this search returns -1 because there are no instances of the search string in that range. [!code-cpp[Array_LastIndexOf#1](~/samples/snippets/cpp/VS_Snippets_CLR/Array_LastIndexOf/cpp/source.cpp#1)] [!code-csharp-interactive[Array_LastIndexOf#1](~/samples/snippets/csharp/VS_Snippets_CLR/Array_LastIndexOf/cs/source.cs#1)] @@ -8423,14 +8423,14 @@ int[,,] TDArray = new int[1,1,1]; ## Examples - The following code example demonstrates the generic method overload and the generic method overload. An array of strings is created, in no particular order. + The following code example demonstrates the generic method overload and the generic method overload. An array of strings is created, in no particular order. The array is displayed, sorted, and displayed again. > [!NOTE] > The calls to the and generic methods do not look any different from calls to their nongeneric counterparts, because Visual Basic, C#, and C++ infer the type of the generic type parameter from the type of the first argument. If you use the [Ildasm.exe (IL Disassembler)](/dotnet/framework/tools/ildasm-exe-il-disassembler) to examine the Microsoft intermediate language (MSIL), you can see that the generic methods are being called. - The generic method overload is then used to search for two strings, one that is not in the array and one that is. The array and the return value of the method are passed to the `ShowWhere` generic method, which displays the index value if the string is found, and otherwise the elements the search string would fall between if it were in the array. The index is negative if the string is not n the array, so the `ShowWhere` method takes the bitwise complement (the ~ operator in C# and Visual C++, `Xor` -1 in Visual Basic) to obtain the index of the first element in the list that is larger than the search string. + The generic method overload is then used to search for two strings, one that is not in the array and one that is. The array and the return value of the method are passed to the `ShowWhere` generic method, which displays the index value if the string is found, and otherwise the elements the search string would fall between if it were in the array. The index is negative if the string is not n the array, so the `ShowWhere` method takes the bitwise complement (the ~ operator in C# and Visual C++, `Xor` -1 in Visual Basic) to obtain the index of the first element in the list that is larger than the search string. :::code language="cpp" source="~/samples/snippets/cpp/VS_Snippets_CLR/Array_SortSearch/cpp/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR/Array_SortSearch/cs/source.cs" interactive="try-dotnet" id="Snippet1"::: @@ -8521,16 +8521,16 @@ int[,,] TDArray = new int[1,1,1]; ## Examples - The following code example demonstrates the generic method overload and the generic method overload. + The following code example demonstrates the generic method overload and the generic method overload. - The code example defines an alternative comparer for strings, named `ReverseCompare`, which implements the `IComparer` (`IComparer(Of String)` in Visual Basic, `IComparer` in Visual C++) generic interface. The comparer calls the method, reversing the order of the comparands so that the strings sort high-to-low instead of low-to-high. + The code example defines an alternative comparer for strings, named `ReverseCompare`, which implements the `IComparer` (`IComparer(Of String)` in Visual Basic, `IComparer` in Visual C++) generic interface. The comparer calls the method, reversing the order of the comparands so that the strings sort high-to-low instead of low-to-high. The array is displayed, sorted, and displayed again. Arrays must be sorted in order to use the method. > [!NOTE] -> The calls to the and generic methods do not look any different from calls to their nongeneric counterparts, because Visual Basic, C#, and C++ infer the type of the generic type parameter from the type of the first argument. If you use the [Ildasm.exe (IL Disassembler)](/dotnet/framework/tools/ildasm-exe-il-disassembler) to examine the Microsoft intermediate language (MSIL), you can see that the generic methods are being called. +> The calls to the and generic methods do not look any different from calls to their nongeneric counterparts, because Visual Basic, C#, and C++ infer the type of the generic type parameter from the type of the first argument. If you use the [Ildasm.exe (IL Disassembler)](/dotnet/framework/tools/ildasm-exe-il-disassembler) to examine the Microsoft intermediate language (MSIL), you can see that the generic methods are being called. - The generic method overload is then used to search for two strings, one that is not in the array and one that is. The array and the return value of the method are passed to the `ShowWhere` generic method, which displays the index value if the string is found, and otherwise the elements the search string would fall between if it were in the array. The index is negative if the string is not n the array, so the `ShowWhere` method takes the bitwise complement (the ~ operator in C# and Visual C++, `Xor` -1 in Visual Basic) to obtain the index of the first element in the list that is larger than the search string. + The generic method overload is then used to search for two strings, one that is not in the array and one that is. The array and the return value of the method are passed to the `ShowWhere` generic method, which displays the index value if the string is found, and otherwise the elements the search string would fall between if it were in the array. The index is negative if the string is not n the array, so the `ShowWhere` method takes the bitwise complement (the ~ operator in C# and Visual C++, `Xor` -1 in Visual Basic) to obtain the index of the first element in the list that is larger than the search string. :::code language="cpp" source="~/samples/snippets/cpp/VS_Snippets_CLR/Array_SortSearchComparer/cpp/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR/Array_SortSearchComparer/cs/source.cs" interactive="try-dotnet" id="Snippet1"::: @@ -8618,7 +8618,7 @@ int[,,] TDArray = new int[1,1,1]; ## Examples - The following code example demonstrates the method overload. + The following code example demonstrates the method overload. The code example defines an alternative comparison method for strings, named `CompareDinosByLength`. This method works as follows: First, the comparands are tested for`null`, and a null reference is treated as less than a non-null. Second, the string lengths are compared, and the longer string is deemed to be greater. Third, if the lengths are equal, ordinary string comparison is used. @@ -8721,14 +8721,14 @@ int[,,] TDArray = new int[1,1,1]; ## Examples - The following code example demonstrates the generic method overload and the generic method overload for sorting a range in an array. + The following code example demonstrates the generic method overload and the generic method overload for sorting a range in an array. - The code example defines an alternative comparer for strings, named `ReverseCompare`, which implements the `IComparer` (`IComparer(Of String)` in Visual Basic, `IComparer` in Visual C++) generic interface. The comparer calls the method, reversing the order of the comparands so that the strings sort high-to-low instead of low-to-high. + The code example defines an alternative comparer for strings, named `ReverseCompare`, which implements the `IComparer` (`IComparer(Of String)` in Visual Basic, `IComparer` in Visual C++) generic interface. The comparer calls the method, reversing the order of the comparands so that the strings sort high-to-low instead of low-to-high. - The code example creates and displays an array of dinosaur names, consisting of three herbivores followed by three carnivores (tyrannosaurids, to be precise). The generic method overload is used to sort the last three elements of the array, which is then displayed. The generic method overload is used with `ReverseCompare` to sort the last three elements in reverse order. The thoroughly confused dinosaurs are displayed again. + The code example creates and displays an array of dinosaur names, consisting of three herbivores followed by three carnivores (tyrannosaurids, to be precise). The generic method overload is used to sort the last three elements of the array, which is then displayed. The generic method overload is used with `ReverseCompare` to sort the last three elements in reverse order. The thoroughly confused dinosaurs are displayed again. > [!NOTE] -> The calls to the and generic methods do not look any different from calls to their nongeneric counterparts, because Visual Basic, C#, and C++ infer the type of the generic type parameter from the type of the first argument. If you use the [Ildasm.exe (IL Disassembler)](/dotnet/framework/tools/ildasm-exe-il-disassembler) to examine the Microsoft intermediate language (MSIL), you can see that the generic methods are being called. +> The calls to the and generic methods do not look any different from calls to their nongeneric counterparts, because Visual Basic, C#, and C++ infer the type of the generic type parameter from the type of the first argument. If you use the [Ildasm.exe (IL Disassembler)](/dotnet/framework/tools/ildasm-exe-il-disassembler) to examine the Microsoft intermediate language (MSIL), you can see that the generic methods are being called. :::code language="cpp" source="~/samples/snippets/cpp/VS_Snippets_CLR/Array_SortIntIntIComparer/cpp/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR/Array_SortIntIntIComparer/cs/source.cs" interactive="try-dotnet" id="Snippet1"::: @@ -8835,14 +8835,14 @@ int[,,] TDArray = new int[1,1,1]; ## Examples - The following code example demonstrates the generic method overload and the generic method overload for sorting a range in an array. + The following code example demonstrates the generic method overload and the generic method overload for sorting a range in an array. - The code example defines an alternative comparer for strings, named `ReverseCompare`, which implements the `IComparer` (`IComparer(Of String)` in Visual Basic, `IComparer` in Visual C++) generic interface. The comparer calls the method, reversing the order of the comparands so that the strings sort high-to-low instead of low-to-high. + The code example defines an alternative comparer for strings, named `ReverseCompare`, which implements the `IComparer` (`IComparer(Of String)` in Visual Basic, `IComparer` in Visual C++) generic interface. The comparer calls the method, reversing the order of the comparands so that the strings sort high-to-low instead of low-to-high. - The code example creates and displays an array of dinosaur names, consisting of three herbivores followed by three carnivores (tyrannosaurids, to be precise). The generic method overload is used to sort the last three elements of the array, which is then displayed. The generic method overload is used with `ReverseCompare` to sort the last three elements in reverse order. The thoroughly confused dinosaurs are displayed again. + The code example creates and displays an array of dinosaur names, consisting of three herbivores followed by three carnivores (tyrannosaurids, to be precise). The generic method overload is used to sort the last three elements of the array, which is then displayed. The generic method overload is used with `ReverseCompare` to sort the last three elements in reverse order. The thoroughly confused dinosaurs are displayed again. > [!NOTE] -> The calls to the and generic methods do not look any different from calls to their nongeneric counterparts, because Visual Basic, C#, and C++ infer the type of the generic type parameter from the type of the first argument. If you use the [Ildasm.exe (IL Disassembler)](/dotnet/framework/tools/ildasm-exe-il-disassembler) to examine the Microsoft intermediate language (MSIL), you can see that the generic methods are being called. +> The calls to the and generic methods do not look any different from calls to their nongeneric counterparts, because Visual Basic, C#, and C++ infer the type of the generic type parameter from the type of the first argument. If you use the [Ildasm.exe (IL Disassembler)](/dotnet/framework/tools/ildasm-exe-il-disassembler) to examine the Microsoft intermediate language (MSIL), you can see that the generic methods are being called. :::code language="cpp" source="~/samples/snippets/cpp/VS_Snippets_CLR/Array_SortIntIntIComparer/cpp/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR/Array_SortIntIntIComparer/cs/source.cs" interactive="try-dotnet" id="Snippet1"::: @@ -8954,19 +8954,19 @@ int[,,] TDArray = new int[1,1,1]; ## Examples - The following code example demonstrates the , , , and generic method overloads, for sorting pairs of arrays that represent keys and values. + The following code example demonstrates the , , , and generic method overloads, for sorting pairs of arrays that represent keys and values. - The code example defines an alternative comparer for strings, named `ReverseCompare`, which implements the `IComparer` (`IComparer(Of String)` in Visual Basic, `IComparer` in Visual C++) generic interface. The comparer calls the method, reversing the order of the comparands so that the strings sort high-to-low instead of low-to-high. + The code example defines an alternative comparer for strings, named `ReverseCompare`, which implements the `IComparer` (`IComparer(Of String)` in Visual Basic, `IComparer` in Visual C++) generic interface. The comparer calls the method, reversing the order of the comparands so that the strings sort high-to-low instead of low-to-high. The code example creates and displays an array of dinosaur names (the keys) and an array of integers representing the maximum length of each dinosaur in meters (the values). The arrays are then sorted and displayed several times: -- The overload is used to sort both arrays in order of the dinosaur names in the first array. +- The overload is used to sort both arrays in order of the dinosaur names in the first array. -- The overload and an instance of `ReverseCompare` are used to reverse the sort order of the paired arrays. +- The overload and an instance of `ReverseCompare` are used to reverse the sort order of the paired arrays. -- The overload is used to sort the last three elements of both arrays. +- The overload is used to sort the last three elements of both arrays. -- The overload is used to sort the last three elements of both arrays in reverse order. +- The overload is used to sort the last three elements of both arrays in reverse order. > [!NOTE] > The calls to the generic methods do not look any different from calls to their nongeneric counterparts, because Visual Basic, C#, and C++ infer the type of the generic type parameter from the type of the first two arguments. If you use the [Ildasm.exe (IL Disassembler)](/dotnet/framework/tools/ildasm-exe-il-disassembler) to examine the Microsoft intermediate language (MSIL), you can see that the generic methods are being called. @@ -9068,24 +9068,22 @@ int[,,] TDArray = new int[1,1,1]; This implementation performs an unstable sort; that is, if two elements are equal, their order might not be preserved. In contrast, a stable sort preserves the order of elements that are equal. - This method is an O(`n` log `n`) operation, where `n` is the of `array`. - - - + This method is an O(`n` log `n`) operation, where `n` is the of `array`. + ## Examples - The following code example demonstrates the , [\], TValue\,, and generic method overloads, for sorting pairs of arrays that represent keys and values. + The following code example demonstrates the , [\], , , and generic method overloads, for sorting pairs of arrays that represent keys and values. - The code example defines an alternative comparer for strings, named `ReverseCompare`, which implements the `IComparer` (`IComparer(Of String)` in Visual Basic, `IComparer` in Visual C++) generic interface. The comparer calls the method, reversing the order of the comparands so that the strings sort high-to-low instead of low-to-high. + The code example defines an alternative comparer for strings, named `ReverseCompare`, which implements the `IComparer` (`IComparer(Of String)` in Visual Basic, `IComparer` in Visual C++) generic interface. The comparer calls the method, reversing the order of the comparands so that the strings sort high-to-low instead of low-to-high. The code example creates and displays an array of dinosaur names (the keys) and an array of integers representing the maximum length of each dinosaur in meters (the values). The arrays are then sorted and displayed several times: -- The overload is used to sort both arrays in order of the dinosaur names in the first array. +- The overload is used to sort both arrays in order of the dinosaur names in the first array. -- The [\], TValue\ overload and an instance of `ReverseCompare` are used to reverse the sort order of the paired arrays. +- The overload and an instance of `ReverseCompare` are used to reverse the sort order of the paired arrays. -- The overload is used to sort the last three elements of both arrays. +- The overload is used to sort the last three elements of both arrays. -- The overload is used to sort the last three elements of both arrays in reverse order. +- The overload is used to sort the last three elements of both arrays in reverse order. > [!NOTE] > The calls to the generic methods do not look any different from calls to their nongeneric counterparts, because Visual Basic, C#, and C++ infer the type of the generic type parameter from the type of the first two arguments. If you use the [Ildasm.exe (IL Disassembler)](/dotnet/framework/tools/ildasm-exe-il-disassembler) to examine the Microsoft intermediate language (MSIL), you can see that the generic methods are being called. @@ -9197,27 +9195,25 @@ int[,,] TDArray = new int[1,1,1]; This implementation performs an unstable sort; that is, if two elements are equal, their order might not be preserved. In contrast, a stable sort preserves the order of elements that are equal. - This method is an O(`n` log `n`) operation, where `n` is `length`. - - + This method is an O(`n` log `n`) operation, where `n` is `length`. ## Examples - The following code example demonstrates the , , [\], TValue\, and generic method overloads, for sorting pairs of arrays that represent keys and values. + The following code example demonstrates the , , , and generic method overloads, for sorting pairs of arrays that represent keys and values. - The code example defines an alternative comparer for strings, named `ReverseCompare`, which implements the `IComparer` (`IComparer(Of String)` in Visual Basic, `IComparer` in Visual C++) generic interface. The comparer calls the method, reversing the order of the comparands so that the strings sort high-to-low instead of low-to-high. + The code example defines an alternative comparer for strings, named `ReverseCompare`, which implements the `IComparer` (`IComparer(Of String)` in Visual Basic, `IComparer` in Visual C++) generic interface. The comparer calls the method, reversing the order of the comparands so that the strings sort high-to-low instead of low-to-high. The code example creates and displays an array of dinosaur names (the keys) and an array of integers representing the maximum length of each dinosaur in meters (the values). The arrays are then sorted and displayed several times: -- The overload is used to sort both arrays in order of the dinosaur names in the first array. +- The overload is used to sort both arrays in order of the dinosaur names in the first array. -- The overload and an instance of `ReverseCompare` are used to reverse the sort order of the paired arrays. +- The overload and an instance of `ReverseCompare` are used to reverse the sort order of the paired arrays. -- The [\], TValue\ overload is used to sort the last three elements of both arrays. +- The overload is used to sort the last three elements of both arrays. -- The overload is used to sort the last three elements of both arrays in reverse order. +- The overload is used to sort the last three elements of both arrays in reverse order. > [!NOTE] -> The calls to the generic methods do not look any different from calls to their nongeneric counterparts, because Visual Basic, C#, and C++ infer the type of the generic type parameter from the type of the first two arguments. If you use the [Ildasm.exe (IL Disassembler)](/dotnet/framework/tools/ildasm-exe-il-disassembler) to examine the Microsoft intermediate language (MSIL), you can see that the generic methods are being called. +> The calls to the generic methods do not look any different from calls to their nongeneric counterparts, because Visual Basic, C#, and C++ infer the type of the generic type parameter from the type of the first two arguments. If you use the [Ildasm.exe (IL Disassembler)](/dotnet/framework/tools/ildasm-exe-il-disassembler) to examine the Microsoft intermediate language (MSIL), you can see that the generic methods are being called. :::code language="cpp" source="~/samples/snippets/cpp/VS_Snippets_CLR/Array_Sort2IntIntIComparer/cpp/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR/Array_Sort2IntIntIComparer/cs/source.cs" interactive="try-dotnet" id="Snippet1"::: @@ -9337,27 +9333,25 @@ int[,,] TDArray = new int[1,1,1]; This implementation performs an unstable sort; that is, if two elements are equal, their order might not be preserved. In contrast, a stable sort preserves the order of elements that are equal. - This method is an O(`n` log `n`) operation, where `n` is `length`. - - + This method is an O(`n` log `n`) operation, where `n` is `length`. ## Examples - The following code example demonstrates the , , , and [\], TValue\ generic method overloads, for sorting pairs of arrays that represent keys and values. + The following code example demonstrates the , , , and generic method overloads, for sorting pairs of arrays that represent keys and values. - The code example defines an alternative comparer for strings, named `ReverseCompare`, which implements the `IComparer`(`IComparer(Of String)` in Visual Basic, `IComparer` in Visual C++) generic interface. The comparer calls the method, reversing the order of the comparands so that the strings sort high-to-low instead of low-to-high. + The code example defines an alternative comparer for strings, named `ReverseCompare`, which implements the `IComparer`(`IComparer(Of String)` in Visual Basic, `IComparer` in Visual C++) generic interface. The comparer calls the method, reversing the order of the comparands so that the strings sort high-to-low instead of low-to-high. The code example creates and displays an array of dinosaur names (the keys) and an array of integers representing the maximum length of each dinosaur in meters (the values). The arrays are then sorted and displayed several times: -- The overload is used to sort both arrays in order of the dinosaur names in the first array. +- The overload is used to sort both arrays in order of the dinosaur names in the first array. -- The overload and an instance of `ReverseCompare` are used to reverse the sort order of the paired arrays. +- The overload and an instance of `ReverseCompare` are used to reverse the sort order of the paired arrays. -- The overload is used to sort the last three elements of both arrays. +- The overload is used to sort the last three elements of both arrays. -- The [\], TValue\ overload is used to sort the last three elements of both arrays in reverse order. +- The overload is used to sort the last three elements of both arrays in reverse order. > [!NOTE] -> The calls to the generic methods do not look any different from calls to their nongeneric counterparts, because Visual Basic, C#, and C++ infer the type of the generic type parameter from the type of the first two arguments. If you use the [Ildasm.exe (IL Disassembler)](/dotnet/framework/tools/ildasm-exe-il-disassembler) to examine the Microsoft intermediate language (MSIL), you can see that the generic methods are being called. +> The calls to the generic methods do not look any different from calls to their nongeneric counterparts, because Visual Basic, C#, and C++ infer the type of the generic type parameter from the type of the first two arguments. If you use the [Ildasm.exe (IL Disassembler)](/dotnet/framework/tools/ildasm-exe-il-disassembler) to examine the Microsoft intermediate language (MSIL), you can see that the generic methods are being called. :::code language="cpp" source="~/samples/snippets/cpp/VS_Snippets_CLR/Array_Sort2IntIntIComparer/cpp/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR/Array_Sort2IntIntIComparer/cs/source.cs" interactive="try-dotnet" id="Snippet1"::: diff --git a/xml/System/_AppDomain.xml b/xml/System/_AppDomain.xml index 087ecb43ed2..87ca8fff88b 100644 --- a/xml/System/_AppDomain.xml +++ b/xml/System/_AppDomain.xml @@ -1785,14 +1785,6 @@ An array of type containing the raw bytes representing the symbols for the assembly. Provides COM objects with version-independent access to the method overload. The loaded assembly. - - method overload. - - ]]> - @@ -1898,14 +1890,6 @@ Evidence for loading the assembly. Provides COM objects with version-independent access to the method overload. The loaded assembly. - - method overload. - - ]]> -