Bismillah ArRahman ArRaheem
Wa-Alaykum As Salaam
That statement in it self does not invalidate the contract between the husband and wife. There are a number of rules for a divorce to become valid, importantly, It is also necessary that a man seriously intends to divorce;". See https://www.sistani.org/english/book/48/2357/
for the various rules and the different kinds of divorce.
Even if you said such a statement and in a moment of frustration and anger, which all three should be avoided (the statement, being frustrated, being angry) and you "swore" to do such a thing, such a swearing does not have an effect, as a condition of an oath to be binding is that it is not said in anger...
See the following:"if he takes an oath involuntarily, or unintentionally, in a state of excitement, the oath will be void. An oath taken for the performance of an act which is haraam or makrooh, is not valid."
Insha-Allah that helps.