Silk Technologies interview question

implement split function and some variations of it.