From 029001bf6b167cc0eb836257b8d4059c235db3c8 Mon Sep 17 00:00:00 2001 From: Daniel-Constantin Mierla Date: Tue, 25 Jun 2024 11:06:15 +0200 Subject: [PATCH] cookbooks/devel/transformations: docs update for {s.select} --- docs/cookbooks/devel/transformations.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/docs/cookbooks/devel/transformations.md b/docs/cookbooks/devel/transformations.md index 835e0913..0856e664 100644 --- a/docs/cookbooks/devel/transformations.md +++ b/docs/cookbooks/devel/transformations.md @@ -102,18 +102,24 @@ Example: ### {s.select,index,separator} Return a field from PV value. The field is selected based on separator -and index. The separator must be a character used to identify the -fields. Index must be an integer value or a PV. If index is negative, the +and index. + +Index must be an integer value or a PV. If index is negative, the count of fields starts from end of PV value, -1 being last field. If index is positive, 0 is the first field. +The separator must be a character used to identify the fields. It can also be +an escaped character: `\\`, `\t`, `\n`, `\r` or `\s` (all whitespaces). + Example: +``` $var(x) = "12,34,56"; $(var(x){s.select,1,,}) => "34" ; $var(x) = "12,34,56"; $(var(x){s.select,-2,,}) => "34" +``` ### {s.encode.7bit}