Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

split string

const str = 'The quick brown fox jumps over the lazy dog.';

const words = str.split(' ');
console.log(words[3]);
// expected output: "fox"

const chars = str.split('');
console.log(chars[8]);
// expected output: "k"

const strCopy = str.split();
console.log(strCopy);
// expected output: Array ["The quick brown fox jumps over the lazy dog."]
Source by www.delftstack.com #
 
PREVIOUS NEXT
Tagged: #split #string
ADD COMMENT
Topic
Name
4+6 =