summaryrefslogtreecommitdiff
path: root/doc/en
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2022-07-20 13:16:35 +0200
committerSébastien Helleu <flashcode@flashtux.org>2022-07-20 13:16:35 +0200
commitb7441bd7a30e1fdee837fad9923d372b4b283374 (patch)
tree1a27579f0d8bfeed77a2377f9245d6b6d6553238 /doc/en
parent62e68f965f7bce87eb0bf61bb134de5a3d3b7507 (diff)
downloadweechat-b7441bd7a30e1fdee837fad9923d372b4b283374.zip
api: add arguments "index_start" and "index_end" in function string_rebuild_split_string
Diffstat (limited to 'doc/en')
-rw-r--r--doc/en/weechat_plugin_api.en.adoc16
1 files changed, 12 insertions, 4 deletions
diff --git a/doc/en/weechat_plugin_api.en.adoc b/doc/en/weechat_plugin_api.en.adoc
index 0434bf54f..8d857272d 100644
--- a/doc/en/weechat_plugin_api.en.adoc
+++ b/doc/en/weechat_plugin_api.en.adoc
@@ -1790,20 +1790,28 @@ This function is not available in scripting API.
==== string_rebuild_split_string
-Rebuild a string with a split string.
+_Updated in 3.7._
+
+Rebuild a string with a split string, using optional separator and index of
+first/last string to use.
Prototype:
[source,c]
----
char *weechat_string_rebuild_split_string (char **split_string,
- const char *separator);
+ const char *separator,
+ int index_start, int index_end);
----
Arguments:
* _split_string_: string split by function <<_string_split,string_split>>
-* _separator_: string used to separate strings
+* _separator_: string used to separate strings (can be NULL or empty string)
+* _index_start_: index of first string to use (≥ 0)
+* _index_end_: index of last string to use
+ (must be ≥ _index_start_; special value -1 can be used to use all arguments
+ until NULL is found)
Return value:
@@ -1816,7 +1824,7 @@ C example:
char **argv;
int argc;
argv = weechat_string_split ("abc def ghi", " ", 0, 0, &argc);
-char *str = weechat_string_rebuild_split_string (argv, ";");
+char *str = weechat_string_rebuild_split_string (argv, ";", 0, -1);
/* str == "abc;def;ghi" */
/* ... */
free (str);