Distinct

C10 - initial

distinct (Sifts)
TypeCorrade progressive sift
Siftdistinct
Parametersthe empty string
DescriptionThe distinct sift will return only unique elements in a list.
Last ChangesNone

The distinct sift will return only unique elements in a list.

Arguments

Position Type Description Example
0 empty string None ""

Example

The following sift when added to a command will skip the first 2 elements, then return the distinct remaining elements and then finally count the number of remaining elements that match the regular expression [0-9]:

    "sift", wasListToCSV([
        "skip", 2,
        "distinct", "",
        "count", "[0-9]"
    ]),

Effect on Returned Data

Given the input

data=a,1,c,2,c,3,h,2,h,5,j,5

the following transformations will take place:

  1. skip, 2 $\leadsto$ data=c,2,c,3,h,2,h,5,j,5,
  2. distinct $\leadsto$ data=c,2,3,h,5,j,
  3. count, [0-9] $\leadsto$ data=6

and expected output is:

data=6

Notes

  • The empty string must be passed as an argument to the distinct sift.

secondlife/scripted_agents/corrade/api/sifts/distinct.txt ยท Last modified: 2022/11/24 07:46 by 127.0.0.1

Access website using Tor Access website using i2p Wizardry and Steamworks PGP Key


For the contact, copyright, license, warranty and privacy terms for the usage of this website please see the contact, license, privacy, copyright.