📜  干净的 url javascript 代码示例

📅  最后修改于: 2022-03-11 15:04:00.888000             🧑  作者: Mango

代码示例1
let int = 0
let cleanupUrl = ""
let url = 'github.com/gin-gonic/gin'
int = url.match(/[/]/g).length

if(int === 2) {
 cleanupUrl = url.replace(/.*[/]/g, '')
}

console.log(cleanupUrl)