Skip to main content

Home > blockly > CodeGenerator > prefixLines

CodeGenerator.prefixLines() method

Prepend a common prefix onto each line of code. Intended for indenting code or adding comment markers.

Signature:

prefixLines(text: string, prefix: string): string;

Parameters

ParameterTypeDescription
textstringThe lines of code.
prefixstringThe common prefix.

Returns:

string

The prefixed lines of code.