mirror of
https://github.com/sfall-team/sfall.git
synced 2026-07-27 16:52:34 -07:00
Renamed "string_pos" function to "string_find"
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
|
||||
#include "sfall.h"
|
||||
|
||||
#define is_in_string(str, sub) (string_pos(str, sub) != -1)
|
||||
#define string_contains(str, sub) (string_find(str, sub) != -1)
|
||||
#define string_starts_with(str, sub) (substr(str, 0, strlen(sub)) == sub)
|
||||
#define string_format_array(fmt, arr) sprintf_array(fmt, arr)
|
||||
// Replaces all occurances of substring in a string with another substring
|
||||
|
||||
@@ -390,8 +390,8 @@
|
||||
#define spatial_radius(obj) sfall_func1("spatial_radius", obj)
|
||||
#define string_compare(str1, str2) sfall_func2("string_compare", str1, str2)
|
||||
#define string_compare_locale(str1, str2, codePage) sfall_func3("string_compare", str1, str2, codePage)
|
||||
#define string_pos(haystack, needle) sfall_func2("string_pos", haystack, needle)
|
||||
#define string_pos_from(haystack, needle, pos) sfall_func3("string_pos", haystack, needle, pos)
|
||||
#define string_find(haystack, needle) sfall_func2("string_find", haystack, needle)
|
||||
#define string_find_from(haystack, needle, pos) sfall_func3("string_find", haystack, needle, pos)
|
||||
#define string_format1(format, a1) sfall_func2("string_format", format, a1)
|
||||
#define string_format2(format, a1, a2) sfall_func3("string_format", format, a1, a2)
|
||||
#define string_format3(format, a1, a2, a3) sfall_func4("string_format", format, a1, a2, a3)
|
||||
|
||||
@@ -1101,9 +1101,9 @@ sfall_funcX metarule functions
|
||||
- Subsequent calls for the same file will return the same array, unless it was disposed using `free_array`
|
||||
|
||||
----
|
||||
#### string_pos
|
||||
`int sfall_func2("string_pos", string haystack, string needle)`
|
||||
`int sfall_func3("string_pos", string haystack, string needle, int pos)`
|
||||
#### string_find
|
||||
`int sfall_func2("string_find", string haystack, string needle)`
|
||||
`int sfall_func3("string_find", string haystack, string needle, int pos)`
|
||||
|
||||
- Returns the position of the first occurrence of a `needle` string in a `haystack` string, or -1 if not found. The first character position is 0 (zero)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user