If performance is going to be an issue, I would suggest using the much more efficient
substr function. Of course, depending on the situation the difference may be neglible, but I've worked on projects where performance was a big issue and this spared me a significant amount of cycles.
Dave