Pocket Gems Interview Question

Implement indexOf function given a haystack and needle string