diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2016-01-24 08:03:55 +0100 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2016-01-24 08:03:55 +0100 |
commit | cd23a5fa925d857bc8624a4c2fa12a0b5829de98 (patch) | |
tree | cb276f92d3dca26b05d6d4ddb22ca8ae84ca305c /doc/en/weechat_plugin_api.en.asciidoc | |
parent | 1a94193147337b4c540febe258b777b635d34bc6 (diff) | |
download | weechat-cd23a5fa925d857bc8624a4c2fa12a0b5829de98.zip |
doc: add an example in function string_split (plugin API reference)
Diffstat (limited to 'doc/en/weechat_plugin_api.en.asciidoc')
-rw-r--r-- | doc/en/weechat_plugin_api.en.asciidoc | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/doc/en/weechat_plugin_api.en.asciidoc b/doc/en/weechat_plugin_api.en.asciidoc index ffc2130ef..c4a87d81a 100644 --- a/doc/en/weechat_plugin_api.en.asciidoc +++ b/doc/en/weechat_plugin_api.en.asciidoc @@ -1452,7 +1452,7 @@ C example: ---- char **argv; int argc; -argv = weechat_string_split ("abc de fghi", " ", 0, 0, &argc); +argv = weechat_string_split ("abc de fghi ", " ", 0, 0, &argc); /* result: argv[0] == "abc" argv[1] == "de" argv[2] == "fghi" @@ -1461,7 +1461,7 @@ argv = weechat_string_split ("abc de fghi", " ", 0, 0, &argc); */ weechat_string_free_split (argv); -argv = weechat_string_split ("abc de fghi", " ", 1, 0, &argc); +argv = weechat_string_split ("abc de fghi ", " ", 1, 0, &argc); /* result: argv[0] == "abc de fghi" argv[1] == "de fghi" argv[2] == "fghi" @@ -1469,6 +1469,15 @@ argv = weechat_string_split ("abc de fghi", " ", 1, 0, &argc); argc == 3 */ weechat_string_free_split (argv); + +argv = weechat_string_split ("abc de fghi ", " ", 2, 0, &argc); +/* result: argv[0] == "abc de fghi " + argv[1] == "de fghi " + argv[2] == "fghi " + argv[3] == NULL + argc == 3 +*/ +weechat_string_free_split (argv); ---- [NOTE] |