aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/LuaSL/src
diff options
context:
space:
mode:
authorDavid Walter Seikel2012-02-23 03:24:14 +1000
committerDavid Walter Seikel2012-02-23 03:24:14 +1000
commitce012fbbc787702bdb008c9395a80d2a08935593 (patch)
treedce072ec4dd5dd42f0c24f2277ca9c8a155217d4 /LuaSL/src
parentFake some more functions in the test harness. (diff)
downloadSledjHamr-ce012fbbc787702bdb008c9395a80d2a08935593.zip
SledjHamr-ce012fbbc787702bdb008c9395a80d2a08935593.tar.gz
SledjHamr-ce012fbbc787702bdb008c9395a80d2a08935593.tar.bz2
SledjHamr-ce012fbbc787702bdb008c9395a80d2a08935593.tar.xz
Implement llSubStringIndex().
Diffstat (limited to '')
-rw-r--r--LuaSL/src/LSL.lua7
1 files changed, 6 insertions, 1 deletions
diff --git a/LuaSL/src/LSL.lua b/LuaSL/src/LSL.lua
index de7f956..3ca31a8 100644
--- a/LuaSL/src/LSL.lua
+++ b/LuaSL/src/LSL.lua
@@ -602,7 +602,7 @@ end
602 602
603 603
604-- LSL string functions 604-- LSL string functions
605function --[[string]] LSL.llGetSubString( --[[string]] text, --[[integer]] start, --[[integer]] End) 605function --[[string]] LSL.llGetSubString(--[[string]] text, --[[integer]] start, --[[integer]] End)
606 -- Deal with the impedance mismatch. 606 -- Deal with the impedance mismatch.
607 if 0 <= start then start = start + 1 end 607 if 0 <= start then start = start + 1 end
608 if 0 <= End then End = End + 1 end 608 if 0 <= End then End = End + 1 end
@@ -610,6 +610,11 @@ function --[[string]] LSL.llGetSubString( --[[string]] text, --[[integer]] start
610 return string.sub(text, start, End) 610 return string.sub(text, start, End)
611end 611end
612 612
613function --[[integer]] LSL.llSubStringIndex(--[[string]] text, --[[string]] sub)
614 local start, End = string.find(text, sub, 1, true)
615 if nil == start then return -1 else return start - 1 end
616end
617
613 618
614-- Crements stuff. 619-- Crements stuff.
615 620