fix: js string split (#38233)

fix #38229
This commit is contained in:
wxiaoguang
2026-06-27 20:09:01 +08:00
committed by GitHub
parent b565f3e00a
commit 16c3216dc6
4 changed files with 60 additions and 18 deletions

View File

@@ -0,0 +1,5 @@
export function cutString(s: string, sep: string): [string, string, boolean] {
const index = s.indexOf(sep);
if (index === -1) return [s, '', false];
return [s.substring(0, index), s.substring(index + sep.length), true];
}