Added substring support and test cases