Câu hỏi được gắn thẻ «trailing-slash»


11
Trả về chuỗi mà không dấu gạch chéo
Tôi có hai biến: site1 = "www.somesite.com"; site2 = "www.somesite.com/"; Tôi muốn làm một cái gì đó như thế này function someFunction(site) { // If the var has a trailing slash (like site2), // remove it and return the site without the trailing slash return no_trailing_slash_url; } Làm thế nào …
Khi sử dụng trang web của chúng tôi, bạn xác nhận rằng bạn đã đọc và hiểu Chính sách cookie và Chính sách bảo mật của chúng tôi.
Licensed under cc by-sa 3.0 with attribution required.