aboutsummaryrefslogtreecommitdiff
path: root/runtime/doc/builtin.txt
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/doc/builtin.txt')
-rw-r--r--runtime/doc/builtin.txt29
1 files changed, 24 insertions, 5 deletions
diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt
index b37ac117f3..c2dc5ddd5b 100644
--- a/runtime/doc/builtin.txt
+++ b/runtime/doc/builtin.txt
@@ -464,6 +464,8 @@ sign_unplacelist({list}) List unplace a list of signs
simplify({filename}) String simplify filename as much as possible
sin({expr}) Float sine of {expr}
sinh({expr}) Float hyperbolic sine of {expr}
+slice({expr}, {start} [, {end}]) String, List or Blob
+ slice of a String, List or Blob
sockconnect({mode}, {address} [, {opts}])
Number Connects to socket
sort({list} [, {func} [, {dict}]])
@@ -484,7 +486,7 @@ str2list({expr} [, {utf8}]) List convert each character of {expr} to
str2nr({expr} [, {base} [, {quoted}]])
Number convert String to Number
strcharlen({expr}) Number character length of the String {expr}
-strcharpart({str}, {start} [, {len}])
+strcharpart({str}, {start} [, {len} [, {skipcc}]])
String {len} characters of {str} at
character {start}
strchars({expr} [, {skipcc}]) Number character count of the String {expr}
@@ -7773,6 +7775,19 @@ sinh({expr}) *sinh()*
Can also be used as a |method|: >
Compute()->sinh()
+slice({expr}, {start} [, {end}]) *slice()*
+ Similar to using a |slice| "expr[start : end]", but "end" is
+ used exclusive. And for a string the indexes are used as
+ character indexes instead of byte indexes.
+ Also, composing characters are not counted.
+ When {end} is omitted the slice continues to the last item.
+ When {end} is -1 the last item is omitted.
+ Returns an empty value if {start} or {end} are invalid.
+
+ Can also be used as a |method|: >
+ GetList()->slice(offset)
+
+
sockconnect({mode}, {address} [, {opts}]) *sockconnect()*
Connect a socket to an address. If {mode} is "pipe" then
{address} should be the path of a local domain socket (on
@@ -8115,12 +8130,16 @@ strcharlen({string}) *strcharlen()*
GetText()->strcharlen()
-strcharpart({src}, {start} [, {len}]) *strcharpart()*
+strcharpart({src}, {start} [, {len} [, {skipcc}]]) *strcharpart()*
Like |strpart()| but using character index and length instead
- of byte index and length. Composing characters are counted
- separately.
+ of byte index and length.
+ When {skipcc} is omitted or zero, composing characters are
+ counted separately.
+ When {skipcc} set to 1, Composing characters are ignored,
+ similar to |slice()|.
When a character index is used where a character does not
- exist it is assumed to be one character. For example: >
+ exist it is omitted and counted as one character. For
+ example: >
strcharpart('abc', -1, 2)
< results in 'a'.