JavaScript http https replace

2021-10-06
2021-10-14
js
str = "http://example.com"; str = str.replace("http://", "https://"); console.log(str); // "https://example.com"

正規表現で先頭だけでも良いかも