to find a substring in main string