Evolution of FLRW spacetime after the birth of a cosmic string