The general equation that shows one non metal replacing another non metal in a compound is showing below"
AB + C = A + CB
A and C are non metal; C displaces A from AB, thus setting A free.
A single displacement reaction is a type of reaction in which one element is substituted for another element in a compound. The non metals of group 17 on the periodic table are the ones, which usually participates in single replacement reaction.