I don't think of other than "Replace Field Contents", selecting function may affect speed a bit.
Left ( text ; Length ( text ) - 1 )
Replace ( text ; Length ( text ) ; 1 ; "" )
Case ( Right ( text ; 1 ) = " " ; <<calculation above>> ; text )
I'm using Replace Field Contents now and recalculation took more than 11 minutes.
So you need faster computer or HDD. Do you use shared file?
Or, where come from such a dirty data (continuously) ?
You can add an auto-enter calc to the field in question.
Trim ( FieldInQuestion )
Uncheck "Do not replace existing".
Copy your formula, and use it in Replace Field Contents. Even though it might take 11 minutes, unless something is putting the spaces back after they are removed, you'll never have to do it again. When new data is entered into the field, spaces will be removed automatically. If you use Auto Enter options on imports, again, the spaces will be removed automatically.
To speed it up from the 11 minutes, you could perform the Replace Field Contents on the server using Perform Script on Server.
After having finished your trimming, I'd save a copy as compacted copy (smaller) and put that one into use.
So you need faster computer or HDD. --> I have SSD disk
Do you use shared file? --> Yes I do.
Or, where come from such a dirty data (continuously) ? --> I imported it from xlsx files
For shared file, you can use PSOS to get faster, as dtcgnet already mentioned. Do it on FMPro mean transferring all data from host to client and to host again.
Did you time it on local copy?
If you import the data, you can calculate when import so that avoid after cleaning up. (Of course, this makes import itself need more time.)
Another advantage of auto-enter is, if use "Replace Field Contents", some records can be skipped by locked from other client.