Not a correct method to chomp strings , but logic works