How to split a js string using split?

Hello. How to split a string of messages from the server, if the server shares it with a semicolon?
var str = "2018-01-31 17:47:27;ul Lenina 29A;DOWN";
document.write(str.split(" "));

how to divide them after every semicolon?
June 8th 19 at 17:07
2 answers
June 8th 19 at 17:09
Solution
Well, in the split transfer instead of a space character separator
For example, I want to separate before the first semicolon...
document.write(str.split(" ; "[0]));
So? - Emie_Torphy commented on June 8th 19 at 17:12
Thank you - Emie_Torphy commented on June 8th 19 at 17:15
that is not what - Kameron_Hilpert34 commented on June 8th 19 at 17:18
June 8th 19 at 17:11
Solution
var str = "2018-01-31 17:47:27;ul Lenina 29A;DOWN";
document.write(str.split(";"));


Read the documentation sometimes.
https://learn.javascript.ru/array-methods
Understood. thank you)) - Emie_Torphy commented on June 8th 19 at 17:14

Find more questions by tags JavaScript