How to get the last part of a string in JavaScript? March 6, 2023 by Tarik One way: var lastPart = url.split("https://stackoverflow.com/").pop();