← Zoho questions

Find substring index

Filed under Zoho · Also reported at PayU, Zscaler

Implement a function to find the first occurrence of a substring (needle) in a string (haystack). Return the starting index of the first occurrence, or -1 if the substring is not found.

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Zoho questions

Collected from public candidate posts and coding forums. Updated Nov 2026.