PHP Classes
elePHPant
Icontem

File: testStringBuilder.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  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: 1 year 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();