Skip to content

Latest commit

 

History

History

convert-a-string-to-an-array

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
  • Completed at: 2023-07-06T20:09:04.917Z

  • Completed languages: java

  • Tags: Arrays, Strings, Fundamentals

  • Rank: 8 kyu

Description

Write a function to split a string and convert it into an array of words.

Examples (Input ==> Output):

"Robin Singh" ==> ["Robin", "Singh"]

"I love arrays they are my favorite" ==> ["I", "love", "arrays", "they", "are", "my", "favorite"]
Words will be separated by exactly one space, without leading or trailing spaces.

There will only be letters and spaces in the input string.