Inhaltsverzeichnis

SplitToArray

The SplitToArray function splits a string according to a list of separators and returns a structure that allows iteration in the RuleSet.

Syntax:

SplitToArray ('string','separator/string', boolean, boolean,)

Parameters:

  1. String which is to be split.
  2. Separator or string which triggers the split.
  3. Remove empty values: true1)/false
  4. Trim values: true2)/false
  5. Separator is a string: true/false3), if this optional parameter is used then the second parameter can be specified as a string and triggers the split point(s).

Example:

Following returns five structure entries with index 0 - 4 and the values.

SplitToArray("Paul;Mustermann;street 22;99999,city", ";,")

The next one results in value: „street 22“

SplitToArray("Paul;Mustermann;Street 22;99999,City", ";,")/Items[@Index = 2]/@Value

Without specification of the third parameter, empty values are removed, so the next statement returns the value: „99999“.

SplitToArray("Paul;; Street 22,,;99999,City", ";,")/Items[@Index = 2]/@Value

The following delivers: 4

count(SplitToArray("Paul;; Street 22,,;99999,City", ";,")/Items) 

Without removing blank values and without trim, by setting parameters three and four to false, the next example returns the value: „ Street 22“.

SplitToArray("Paul;; Street 22,,;99999,City", ";,", false, false)/Items[@Index = 2]/@Value

Use a string as a separator: @Rg_Betreff = „Test Erechnung
Zeile 2“

SplitToArray( @Rg_Subject, '
', true(), true() )

Note: Build a hierarchy using function SplitToArray()

1) , 2) , 3)
default Value