Methylene blue
After first acidifying a water sample (with boric acid, for example), one adds to it chloroform and a solution of methylene blue et al. Methylene blue is a cationic dye. The biphasic solution is then agitated to distribute these reagents throughout the aqueous and organic phases. If an anionic surfactant is present, then the cationic methylene blue and the anionic surfactant forms an ion pair, which is extracted into the organic phase. The color saturation of the chloroform increases with the concentration of anionic surfactants.