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

StringBuilderReplace

Replaces characters from start to end (1-based, inclusive) with value.

Method Signature

StringBuilderReplace(stringBuilder=[stringBuilder], start=[integer], end=[integer], value=[any])

Arguments

Argument
Type
Required
Description
Default

stringBuilder

stringBuilder

true

The StringBuilder to modify.

start

integer

true

The 1-based start position (inclusive).

end

integer

true

The 1-based end position (inclusive).

value

any

true

The replacement text. Coerced to string.

Examples

Replace a range with stringBuilderReplace()

Replaces characters using 1-based, inclusive start and end positions.

sb = sb{'Hello World'};
stringBuilderReplace( sb, 7, 11, 'BoxLang' );
writeOutput( sb.toString() );

Result: Hello BoxLang

Member usage

Result: Hello BoxLang

Last updated

Was this helpful?