klaussilveira/SimpleString — pull request #8 by tobya (2012-12-31 01:37:23+00:00)
Title: Explode iterator

Hi

I'm not sure if this is something you are like, but I thought it would be fun to see if I could implement the explode function as an iterator. It slightly breaks your model, but I think it works nicely. I have added an example of how it works to the `demo.php` file.

/**
* Can be used as an iterator after call to explode function
*/
$string = new SimpleString('Lorem,ipsum,dolar,sit,amet,lorem,ipsum');
foreach($string->explode(',') as $key => $value)
{
echo "
Explode Value $key = $value";
}

I know you want to keep your design really simple and every function should return a string so if you feel that this change doesn't fit in that's cool. If you think its good then I'd like any feedback to make it better.