The strings package also provides the various SplitXXX functions that could help you to achieve more specific tasks.