How can the indexOf and substring methods be used to divide an existing string into two parts?

I have been wondering about this question and I don’t have an answer yet. Can someone help me figure this out?

  1. How can the indexOf and substring methods be used to divide an existing string into two parts?

I am not trying to achieve anything. I just want to generally know how they can be used to divide strings.