A method of obtaining pure water from water containing a salt, as in desalination. The water to be purified is fed into a cell containing two electrodes. Between the electrodes is placed an array of semipermeable membranes alternately semipermeable to positive ions and negative ions. The ions tend to segregate between alternate pairs of membranes, leaving pure water in the other gaps between membranes. In this way, the feed water is separated into two streams: one of pure water and the other of more concentrated solution.