Place one end of the string over the top of the ice cube. Sprinkle some salt over the string and the ice cube. Count slowly to ten. Gently lift the ice cube out of the water.
Salt makes ice melt, and the string can sink into the ice cube a little.
Because the ice is still cold it freezes again, trapping the string. This allows the ice cube to be lifted out of the glass of water by the string. This all happens very quickly. Salt melts ice. This is why we put salt on the sidewalks in winter.