Nomura interview question

Q: How to implement substring() function in Java?