This "feels" like it could be made faster. indexOf and substring will loop through the chars - so we're doing it at least twice for each call of splitLoop. I'm thinking that a StringBuilder can be used to accumulate the left side of the split until 'c' is reached. Everything else is then the right side.