I found myself wishing today there was the opposite function to ifString.Split() - i.e. if Split() "explodes" string to pieces, there be a function that "implodes" pieces to a string.
A good illustration of the need is this thread
viewtopic.php?f=34&t=96379 - say i am writing a url-encode function - can the new string be constructed by appending character after character - sure, but that's a lot of churn. Instead if i can blow the string into array of 1-char strings, replace some of them and join them into one, that would be fancy.
So, a proposal - to define a function or method that can do that. Something with signature like:
- ifEnum.joinToStr(sep as String=""), e.g. .joinToStr()
- ifStringOps.join(list as ifEnum), e.g. )
- ifGlobal.strJoin(sep as String="", list as ifEnum), e.g. )
How would such a mythical creature work? Enumerate the collection, calling toStr() on each element and then join them with separator between (i threw ifEnum and toStr() in in attempt at generality).
Discussion: (3) probably not likely to happen for concerns of polluting the global namespace. (2) is the tack Python takes, it's pure in the sense keeps the method in the String namespace but in my experience confusing to beginners (as me at the time) whose intuition is the reverse method to be invoked on the array, i.e. (1).
Just an idea, it's a "nice to have" feature.