Slicing strings

The slice() function allows strings to be split at specific index stops, similar to the fixed width text to columns function in Excel

This is useful if there is no character that can be used as a delimiter but the text conforms to a standard format

The first character in the text string is index = 0

The generic form is String(node.<property>).slice([index1], [index2]) and it returns the text block from the first index (inclusive) to the second index (exclusive) of the property

Missing out the stop index [index2] will return the rest of the text in the string

So String(node.<property>).slice([index1]) will return all text from the first index (inclusive)

You want to take the ‘£’ off a list of bonus data.

Use slice() to return a sub string of text.

String(node.CurrentBonus).slice(1)

image

NOTE slice will only work with strings (text).

results matching ""

    No results matching ""

    results matching ""

      No results matching ""