Last updated on Sep 15, 2021 by Suraj Sharma
To divide a string into words you can use the
string.split() method and pass a whitespace as an argument to the
split() method. It returns an array of words.
Rate this post
Suraj Sharma is a Full Stack Software Engineer. He holds a B.Tech degree in Computer Science & Engineering from NIT Rourkela.