non of those examples have a space at the end
The TRIM() function in a new cell , will remove leading and trailing spaces , if you want to clean up a column then likely to need VBA , which i do provide for forums
An alternative if you do not wish to use VBA or add a new column to remove the spaces, then bring your table/range to Power Query. Use the Trim function and then close and load back to native excel.