Split a text into multiple

Example 1: Split text with comma separator

7,45,31,12 is a text of numbers separated by commas, find the largest number.

Write SPL script:


A

1

7,45,31,12

2

=A1.split@cp().max()

 

A1 text separated by commas

 

A2 The function split splits the text into a sequence, @c means splitting by comma (you can also use the parameter "," without adding @c), @p means automatically parsing data types, such as integer text parsing into integers. The result is: 45

 

Example 2: Split text with escape character separator

1

 

2

 

A text of numbers separated by carriage returns to find the largest number.

 

Write the SPL script:


A

1

1

2

2

=A1.split@np().max()

 

A1 A text of numbers separated by carriage returns

 

A2 The function split splits a text into a sequence, @n means split by carriage returns (you can also use the parameter "\n" without adding @n), @p means automatically parse the data type, such as parsing an integer text into an integer . The result is: 2

 

Example 3: Split text with multi-character separator

7as45df31as12 is a text separated by multiple characters, the original text is split into multiple texts according to the separator "df"

Write SPL script:


A

1

7as45df31as12

2

=A1.split("df")

 

A1 text separated by multiple characters

 

A2 The function split splits the text into sequences, the parameter "df" is used as the separator, and the result is:

 

7as45

 

31as12