inside a script is there a way to disconnect a child from its paretn in c#

i want to disconnect a rocket that is attached to a helicpter when it is fired , but it is connected in a hierarchy, so if a move the rocket and then move the helicpter , the rocket would still be attached,
so how do i disconnect it within a script

Just set the rockets transform.parent = null.