diff options
author | merakor <cem@ckyln.com> | 2021-01-04 10:19:51 +0000 |
---|---|---|
committer | merakor <cem@ckyln.com> | 2021-01-04 10:19:51 +0000 |
commit | 48e9d0bd6b4682a6c2ed744431870cc54fb1d320 (patch) | |
tree | 9456c791d11373c8e7a81338bd75bed7d0567f00 | |
parent | d0dacf8bec5a19a89eb1bcc64723c2d1d6c110ba (diff) | |
download | cpt-48e9d0bd6b4682a6c2ed744431870cc54fb1d320.tar.gz |
docs: update
FossilOrigin-Name: f6b84f77b10b0ddc6f9560fe44b6ec4504dc3dac81c9c30df5b2017a333dbb26
-rw-r--r-- | docs/cpt.org | 37 |
1 files changed, 29 insertions, 8 deletions
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 |