to check strings are matched or not