Constructors
The class System.Text.StringBuilder
can be used to build complex strings. The StringBuilder
class has a number of constructors which can be viewed on the MSDN class library, as shown in the following screenshot:
PowerShell is also able to show the list of constructors. However, PowerShell cannot show the descriptive text. This may be useful as a reminder if the general functionality is already known. In PowerShell 5.0, the following syntax may be used to list the constructors:
PS> [System.Text.StringBuilder]::new OverloadDefinitions ------------------- System.Text.StringBuilder new() System.Text.StringBuilder new(int capacity) System.Text.StringBuilder new(string value) System.Text.StringBuilder new(string value, int capacity) System.Text.StringBuilder new(string value, int startIndex, int length, int capacity) System.Text.StringBuilder new(int capacity, int maxCapacity)
For older versions of PowerShell, a longer, less descriptive alternative is available:
PS> [System.Text...