Then I think the fastest way is to do a one-time update first.
UPDATE TableA SET Column1 = LTRIM(RTRIM(Column1))
UPDATE TableB SET Column2 = LTRIM(RTRIM(Column2))and then use a normal INNER JOIN.
If an update is not possible then I think a
INNER JOIN TableB ON LTRIM(TableB.Column2) = RTRIM(TableA.Column1)If value in fields has exact the same number of characters a join as following might be faster
INNER JOIN TableB ON RIGHT(TableB.Column2, 6) = LEFT(TableA.Column1, 6)