Handy algorithms for NSString