summaryrefslogtreecommitdiff
path: root/src/text.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/text.c')
-rw-r--r--src/text.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/text.c b/src/text.c
index 792507d..43069d1 100644
--- a/src/text.c
+++ b/src/text.c
@@ -1197,3 +1197,19 @@ int ltextTextSplit( lua_State* L ) {
return 1;
}
+
+/*
+> index = RL.TextFindIndex( string text, string find )
+
+Find first text occurrence within a string
+
+- Success return int
+*/
+int ltextTextFindIndex( lua_State* L ) {
+ const char* text = luaL_checkstring( L, 1 );
+ const char* find = luaL_checkstring( L, 2 );
+
+ lua_pushinteger( L, TextFindIndex( text, find ) );
+
+ return 1;
+}