add indexof method

todo: need to be fixed when last character of string is speficied.