PHP Classes

File: testStringBuilder.php

Recommend this page to a friend!
  Classes of Preslav Panayotov   PHP StringBuilder   testStringBuilder.php   Download  
File: testStringBuilder.php
Role: Example script
Content type: text/plain
Description: Test file for StringBuilder
Class: PHP StringBuilder
Manipulate string similar to Java stringBuilder
Author: By
Last change:
Date: 11 years ago
Size: 542 bytes
 

Contents

Class file image Download
<?php
include_once('StringBuilder.php');

$stringBuilder = StringBuilder::newInstance();

$stringBuilder->append("Text 1 2 3 ");
$stringBuilder->append("Some more text here and here and over there");

echo
"\n This StringBuilder has {$stringBuilder->length()} letters \n ";
echo
" Data from this StringBuilder : \n";
echo
"<pre> {$stringBuilder->toString()} </pre>";

echo
"\n Cleaning data : \n"; $stringBuilder->__clear();

echo
"\n creating new instance \n ";
$newSB = null;
$newSB = StringBuilder::newInstance();