use instr and substr