While discussing #wordpress code recently I realized I have a preference for untrailingslashit() over trailingslashit(). I decided to capture these thoughts so I don't have to think about it next time. 😀
https://salferrarello.com/untrailingslashit-vs-trailingslashit/
trailingslashit() vs untrailingslashit() - Sal Ferrarello
WordPress has two functions that can be helpful when dealing with the final character of a URL, trailingslashit() and untrailingslashit(). I find it preferable to use untrailingslashit() for two reasons: 1. It does not break empty checks and 2. It makes my sprintf() statements more readable.