add splitLeading() and splitTrailing() to String, fixing #448