Skip to main content

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

Parameter

Type

Description

text

string

The lines of code.

prefix

string

The common prefix.

Returns:

string

The prefixed lines of code.