From ab6693d4b44e11dcf51771f5004e11e33c68c2cf Mon Sep 17 00:00:00 2001 From: Luo <82520819+Jerry-306@users.noreply.github.com> Date: Sat, 21 May 2022 09:57:03 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BA=A0=E6=AD=A3=200093.=E5=A4=8D=E5=88=B6IP?= =?UTF-8?q?=E5=9C=B0=E5=9D=80=20JavaScript=20=E7=89=88=E6=9C=AC=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit String 实例 substr 方法已弃用,请使用 slice 方法 --- problems/0093.复原IP地址.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/problems/0093.复原IP地址.md b/problems/0093.复原IP地址.md index 6401824b..d5eaa8ab 100644 --- a/problems/0093.复原IP地址.md +++ b/problems/0093.复原IP地址.md @@ -444,7 +444,7 @@ var restoreIpAddresses = function(s) { return; } for(let j = i; j < s.length; j++) { - const str = s.substr(i, j - i + 1); + const str = s.slice(i, j + 1); if(str.length > 3 || +str > 255) break; if(str.length > 1 && str[0] === "0") break; path.push(str);