Sunday, 13 November 2022

Why is it string.join(list) instead of list.join(string)?

This has always confused me. It seems like this would be nicer:

["Hello", "world"].join("-")

Than this:

"-".join(["Hello", "world"])

Is there a specific reason it is like this?



from Why is it string.join(list) instead of list.join(string)?

No comments:

Post a Comment