Legend

Class
Struct
Enum
Interface
Delegate
Constructor
Method
Property
Event
Field

Extension method: string Indent(this string, int, bool)

Declaration

public static string Indent(
    this string str,
    int by,
    bool indentFirstLine = true
)

Summary

Inserts spaces at the beginning of every line contained within the specified string.

Parameters

this stringstr String to add indentation to.
intby Number of spaces to add.
boolindentFirstLine If true (default), all lines are indented; otherwise, all lines except the first.

Returns

The indented string.