Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
次のような URL があります: http://www.mysite.com/page/blog/category/postname/
私がする必要があるのは、それを 3 番目から最後の '/' に分割することです。
どうすればいいですか????
これを試して:
var last3 = str.split("/").slice(-3).join("/");