/ LJCPHPCodeDoc / LJCTextBuilderLib / LJCTextBuilder / GetIndented


Parameters
$text - The add text.

Returns

The potentially indented new text value.

Syntax

PHP
public function GetIndented(string $text): string

Gets a new potentially indented line.

Example

PHP
 $tb = new LJCTextBuilder();
 
 // Example Method:
 $result = hb->GetIndented("This text is NOT indented.");
 $tb->AddText($result);
 
 $tb->AddIndent(2);
 $tb->AddLine();
 $result = $tb->GetIndented("This text is indented.");
 $tb->Text($result, addIndent: false);
 $result = $tb->ToString();
 
 // result:
 // This text is NOT indented.
 //     This text is indented.

Copyright © Lester J. Clark and Contributors.
Licensed under the MIT License.