Edward Thrashcort said:
Speed isn't really a major concern, but I like code that's efficient and
compact. One-liners are great. If I don't particularly understand a one
line function, I simply treat it as a "black box"
One-liners may be "efficient" in terms of lines coded, but I would query
whether they are necessarily efficient in other terms, such as whether the
code is easily readable (and therefore maintainable) or whether it executes
quickly.
As it happens, in this particular case, it is relatively readable and
understandable, and generally speaking, string-handling routines are so
quick compared to operations on the Word object model that execution speed
is not a concern - the time spent executing string handling stuff is usually
a trivial proportion of the total execution time.
But that doesn't necessarily apply to all one-liners.
--
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition
www.classicvb.org