added rsplit. fixed rsearch for a case when both string and pattern are empty.
incorporated comments and corrections
Merge pull request #3477 from tanmaykm/rsplit

added rsplit. fix rsearch for case when both string and pattern are empty