There should be a gas valve at the connection. To turn off gas, the valve should be perpendicular to the outlet pipe. Once closed, you can use a wrench to remove the flexible gas supply line to the dryer. Be sure you don't turn the valve as you are removing the flex line. You may need a second wrench.
If you are getting rid of the dryer, why not just leave it?