Are you sure it returns an actual space and not an empty string? My tests show that it returns an empty string, which is what I would expect. I use a mapping table to squeeze out extra blanks when I need to.
MAPPING LOAD repeat(' ',recno()+1) , ' '
AutoGenerate 10 // Squeeze up to 11 blanks
LOAD subfield( MapSubstring('SpaceMap', myfield), ' ',2) as ....
You may disagree with how QlikView has implemented subfield, but it works according to the documentation and is unlikely to change.
You can have mulltiple characters as the delimiter and subfield works correctly, but subfield does not support variable length delimiters. If the delimiter length varies, then you will need to correct this before passing the data to the subfield command.
I cannot comment on whether using replace is more efficient than trim/mid/index, but replace is simpler to implement, especially where numerous delimiters may exist.
In QlikView TRIM removes leading and trailing spaces from a string. It does not remove spaces within a string.
In Excel, trim removes all spaces from a string except for a single space between words.
QlikView is not excel, both have a trim function, but they produce different results.
The F1 help defines the syntax and function of an expression, different languages have subtle differences between similar commands, you cannot assume that functionality will be identical in different programming languages.
QlikView Trim is doing its job as it should, but this is not the same as trim in Excel..