CA PAM::. Working with array - How to use split command?

Document created by TMACUL Champion on Jan 5, 2017
Version 1Show Document
  • View in full screen mode

Definition and Usage

 

The split() method is used to split a string into an array of substrings, and returns the new array.

Tip: If an empty string ("") is used as the separator, the string is split between each character.

 

Note: The split() method does not change the original string.

 

 

Syntax:

string.split(separator, limit)

 

Parameter Values

 

ParameterDescription
separatorOptional. Specifies the character, or the regular expression, to use for splitting the string. If omitted, the entire string will be returned (an array with only one item)
limitOptional. An integer that specifies the number of splits, items after the split limit will not be included in the array

 

Example:

Process.a = new String([10, 205, 210, 250, 280, 300, 305, 310, 40]);

Process.E = Process.a.split(',');

Process.C = Process.E[1];

Process.D = 5 + ~~C;

By ElwynnMartin 

 

 

Load an array in particular sequence 

JavaScript String split() Method 

4 people found this helpful

Attachments

    Outcomes