A compound having the formula: X−N+(CH3)(CH2CH2OH)2[(CH2)n—COO—R1] and a polymer having the repeat unit: X−{—OCH2CH2—N+(CH3)[(CH2)n—CO—Y]—CH2CH2O—CO—NH—R2—NH—CO—}. R1 is an ester protecting group, R2 is an organic group, X is a halide, and n is a positive integer. Each Y is O−Z+ or O—R1, where Z+ is a cation from an aqueous base. A method of reacting N-methyldiethanolamine with an ω-halo-n-alkanoate ester to form the above compound.