不带尾部斜杠的返回字符串
2022-08-30 00:24:52
我有两个变量:
site1 = "www.somesite.com";
site2 = "www.somesite.com/";
我想做这样的事情
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;
}
我该怎么做?