how can i erase an edge that is on a flat surface

i want to delete an edge that is on a flat surface without deleting the face.

the image shown is going to be a wall socket and i want to erase the extra edges on the flat surface.

is this possible? thanks

Select the edge you want to get rid of.

Press X, and select Dissolve.

Alternatively, spacebar > search for Dissolve.

X / dissolve
Whether it will work depends on the topology of the mesh. For example you cannot have a hole in a face so you can’t get rid of all the edges. Also look in the toolshelf when you dissolve as there will also be the option to also dissolve any associated vertices

thanks. will experiment more with it