From 9f1bec39f9d3d67c5d194fa4553c2ace09656a1c Mon Sep 17 00:00:00 2001 From: jussi Date: Sat, 24 Feb 2024 17:27:34 +0200 Subject: Api Scanner. --- src/text.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/text.c') 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; +} -- cgit v1.2.3