The group responsible for the removal of cations in ion exchange resin is
–NH3OH
–COOH
–OH
–SH
→ 2 R-H + Ca+2 → (R)2Ca + 2H+
Ca+2 cation is exchanged by H+ of resin
Cl- Anion of hard water is exchanged by -OH anion of resin.