For the complete documentation index, see llms.txt. This page is also available as Markdown.

StringBuilderNew

Create a new StringBuilder instance or wrap an existing Java StringBuilder.

Method Signature

StringBuilderNew(value=[any], capacity=[integer])

Arguments

Argument
Type
Required
Description
Default

value

any

false

Optional initial value (String) or existing Java StringBuilder to wrap. Empty if not provided.

capacity

integer

false

Optional initial capacity for newly created BoxStringBuilder instances.

0

Examples

Create a StringBuilder with stringBuilderNew()

Creates a new StringBuilder instance.

result = stringBuilderNew();
writeOutput( result.toString() );

Result: (empty string)

Create a seeded StringBuilder

result = stringBuilderNew( 'hello' );
writeOutput( result.toString() );

Result: hello

Create an empty StringBuilder with explicit capacity

Result: at least 64

Create a seeded StringBuilder with explicit capacity

Result: hello

Last updated

Was this helpful?