StringBuilderExtensionsAppendWithSeparator Method |
Method adding a separator between the appended texts, but only if the string builder is not empty.
This avoids trailing separators, which commonly should appear only 'inside' the individual text elements.
Namespace:
Ptv.XServer.Controls.Map.Tools
Assembly:
Ptv.XServer.Controls.Map (in Ptv.XServer.Controls.Map.dll) Version: 1.7.10.0
Syntax public static void AppendWithSeparator(
this StringBuilder stringBuilder,
string text,
string separator = ","
)
<ExtensionAttribute>
Public Shared Sub AppendWithSeparator (
stringBuilder As StringBuilder,
text As String,
Optional separator As String = ","
)
public:
[ExtensionAttribute]
static void AppendWithSeparator(
StringBuilder^ stringBuilder,
String^ text,
String^ separator = L","
)
[<ExtensionAttribute>]
static member AppendWithSeparator :
stringBuilder : StringBuilder *
text : string *
?separator : string
(* Defaults:
let _separator = defaultArg separator ","
*)
-> unit
Parameters
- stringBuilder
- Type: System.TextStringBuilder
Variable to add texts with separators. - text
- Type: SystemString
Text which should be appended to the stringBuilder. - separator (Optional)
- Type: SystemString
Separator inserted between the appended texts.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type
StringBuilder. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).
See Also