You also removed the hyphen in "t-bar".
If that text is in cell B2 then in cell C2 (for example)
=SUBSTITUTE(SUBSTITUTE(B2,"-","")," ","-")
If it is a column of cells with text like this then fill down with the formula in C2 to complete the column.
The inner SUBSTITUTE removes all existing hyphens, replacing them with nothing. The outer one changes all space characters into hyphens. If you find any cases where you get double hyphens it means there were two spaces there. You can use TRIM in the formula to fix any double spaces beforehand. I did that in the formula below
=SUBSTITUTE(SUBSTITUTE(TRIM(B2),"-","")," ","-")