i have never used this function, nor do i recall e...
# cfml-general
w
i have never used this function, nor do i recall even being aware of it. has anyone used insert()? i didn't even know what it does based solely on its name. https://cfdocs.org/insert
s
The examples on that page make it pretty clear, no? It inserts one string into another at the specified position.
w
i wasn't saying i have reading comprehension difficulties, just that i don't recall even being aware of this BIF. just weird, been doing this awhile and it was 'new' to me
👍🏻 1
s
I suspect there are lots of BIFs I don't know -- and I did CFML day-in, day-out for about 15 years 😕
(I didn't know CFML had that BIF either but I've seen similar fns in other languages)
w
i mean it makes sense and all, but i never encountered the need to use it, or ended doing an alternate thing for all this time? i feel dirty now.
i feel like i should abuse using insert() now to make up for all the lost time
s
I don't recall ever needing to insert one string into another, based on position -- in over 40 years of software development 🙂 At the end, yes. In front of a string, yes. But both of those can be done by concatenation.
w
right
strings are overrated anyway
🤣 1
s
I guess if you find yourself writing
left(s1,n) & s2 & right(s1,len(s1)-n)
a lot, then
insert(s1,s2,n)
is kinda useful...
✔️ 1
r
Functions without prefix refer to string functions, I guess
at least I understood it this way, in CF main type is a String, default type maybe, so function like Left Right Len - are about Strings, but ListLen, ArrayLen are for respective types