From 48e9d0bd6b4682a6c2ed744431870cc54fb1d320 Mon Sep 17 00:00:00 2001 From: merakor Date: Mon, 4 Jan 2021 10:19:51 +0000 Subject: docs: update FossilOrigin-Name: f6b84f77b10b0ddc6f9560fe44b6ec4504dc3dac81c9c30df5b2017a333dbb26 --- docs/cpt.org | 37 +++++++++++++++++++++++++++++-------- 1 file changed, 29 insertions(+), 8 deletions(-) (limited to 'docs') diff --git a/docs/cpt.org b/docs/cpt.org index bff8ac9..9b475a8 100644 --- a/docs/cpt.org +++ b/docs/cpt.org @@ -890,11 +890,11 @@ Following functions are used to manipulate, check, or interact with text. given string. If the string is inside the list, it will return 0, otherwise 1. #+begin_src sh - # Usage - contains "$LIST" foo +# Usage +contains "$LIST" foo - contains "foo bar" foo # Returns 0 - contains "foo bar" baz # Returns 1 +contains "foo bar" foo # Returns 0 +contains "foo bar" baz # Returns 1 #+end_src *** =regesc()= @@ -906,7 +906,7 @@ given string. If the string is inside the list, it will return 0, otherwise 1. in POSIX BRE. Those characters are, =$=, =.=, =*=, =[=, =\\=, and =^=. #+begin_src sh - regesc '^[$\' # Returns \^\[\$\\ +regesc '^[$\' # Returns \^\[\$\\ #+end_src *** =pop()= @@ -918,10 +918,31 @@ in POSIX BRE. Those characters are, =$=, =.=, =*=, =[=, =\\=, and =^=. call. Word splitting is intentional when using this function. #+begin_src sh - # Usage - pop foo from $LIST +# Usage +pop foo from $LIST - pop foo from foo baz bar # Returns baz bar +pop foo from foo baz bar # Returns baz bar +#+end_src + +*** =sepchar()= +:PROPERTIES: +:DESCRIPTION: Separate characters from a string +:END: + +This function can be used to separate characters from the given string without +resorting to external resources. + +#+begin_src sh +sepchar mystring +# Prints: +# m +# y +# s +# t +# r +# i +# n +# g #+end_src ** System Functions -- cgit v1.2.3