Removing values in array without filter() in Google Sheets


I want to remove specific (or any) values in dynamic array/range and return the result of the resized array without those values without using filter() as I need to use arrayformula.

For example,

{“”,””,”A”,””,”B”} // size: 5

to

{“A”,”B”} // size: 2

Is there a way to do this?