CGI Interview Question

Coding like finding substring and letters of each word