Splitting a String into an Array of Substrings

Learn how to split strings into arrays using the 'split' method.

The split method

The split method splits a string into an array of substrings. Split expects one argument describing how the split should be made.

For instance, in the programming world, we often process CSV files. CSV stands for Comma Separated Values. Let’s create an array from a CSV line:

Get hands-on with 1200+ tech skills courses.