Class InstantSB
- Assembly
- SunamoDevCode.dll
String builder that automatically separates appended items with a specified delimiter.
public class InstantSB
- Inheritance
-
InstantSB
- Derived
- Inherited Members
- Extension Methods
Constructors
InstantSB(string)
Initializes a new InstantSB with the specified delimiter between items.
public InstantSB(string delimiter)
Parameters
delimiterstringDelimiter string to insert between items.
Properties
Length
Gets the current length of the accumulated output.
public int Length { get; }
Property Value
StringBuilder
Gets or sets the underlying StringBuilder used for building output.
public StringBuilder StringBuilder { get; set; }
Property Value
Methods
AddItem(string)
Adds a value followed by the delimiter, skipping if the value equals the delimiter or is empty.
public void AddItem(string value)
Parameters
valuestringValue to add.
AddItems(params string[])
Adds multiple items, each followed by the delimiter.
public void AddItems(params string[] items)
Parameters
itemsstring[]Items to add.
AddRaw(object)
Adds the string representation of an object without any delimiter.
public void AddRaw(object content)
Parameters
contentobjectObject whose string representation to append.
AppendLine()
Appends a newline.
public void AppendLine()
AppendLine(string)
Appends text followed by a newline.
public void AppendLine(string text)
Parameters
textstringText to append.
Clear()
Clears all accumulated output.
public void Clear()
EndLine(object)
Adds content without delimiter, typically used at the end of a line.
public void EndLine(object content)
Parameters
contentobjectContent to append.
RemoveEndDelimiter()
Removes the trailing delimiter from the accumulated output.
public void RemoveEndDelimiter()
ToString()
Returns the accumulated output as a string.
public override string ToString()
Returns
- string
The built string.