Fix string.find (#1390)

This commit is contained in:
Lennart Ochel
2025-05-09 14:00:21 +02:00
committed by GitHub
parent b93f622e9b
commit 9eb9ab2401
2 changed files with 7 additions and 1 deletions
+1 -1
View File
@@ -94,7 +94,7 @@ export const stringApi = new LuaTable({
const reg = new RegExp(pattern);
const index = s.slice(init - 1).search(reg);
if (index < 0) return;
if (index < 0) return null;
const match = s.slice(init - 1).match(reg);
const result = [index + init, index + init + match![0].length - 1];