text.split code example
Example 1: python split
>>> '1,2,3'.split(',')
['1', '2', '3']
>>> '1,2,3'.split(',', maxsplit=1)
['1', '2,3']
>>> '1,2,,3,'.split(',')
['1', '2', '', '3', '']
Example 2: split string
const str = 'The quick brown fox jumps over the lazy dog.';
const words = str.split(' ');
console.log(words[3]);
const chars = str.split('');
console.log(chars[8]);
const strCopy = str.split();
console.log(strCopy);
Example 3: python split string on char
>>> "MATCHES__STRING".split("__")
['MATCHES', 'STRING']