/ LJCPHPCodeDoc / LJCTextBuilderLib / LJCTextBuilder / GetWrapped


Parameters
$text - The text value.

Returns

The wrapped string.

Syntax

PHP
public function GetWrapped(string $text): string

Appends added text and new wrapped line.

Remarks

Creates new wrapped line if combined line > LineLimit.

Example

PHP
 $tb = new LJCTextBuilder();
 $tb->WrapEnabled = true;
 
 // Example Method:
 $tb->AddText("Now is the time for all good men to come to the aid of their");
 $tb->AddText(" country.");
 $tb->AddText(" Now is the time for all good men to come to the aid of their");
 $tb->AddText(" country.");
 $text = $tb->ToString();
 $result = $tb->GetWrapped($text);
 
 // result:
 // Now is the time for all good men to come to the aid of
 //  their country. Now is the
 // time for all good men to come to the aid of their country.

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