Nomura Interview Question

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