3

How I can get this

array = ["apple", "orange kiwi", "lemon"];

to this

array["apple", "orange", "kiwi", "lemon"];

split array row in multiple keys if there is space in it.

tnx

1
  • 1
    Careful with the vocabulary used here. The keys in an array are the numbers used to access values. It would probably be best to speak of splitting entries or rows with spaces in them, but not keys. Commented Nov 30, 2015 at 13:44

1 Answer 1

5

Join and split?

array = ["apple", "orange kiwi", "lemon"];

array = array.join(" ").split(" ");
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.