A
A
adrash kh2018-02-01 12:00:20
JavaScript
adrash kh, 2018-02-01 12:00:20

How to split string in js using split?

Hello. How to split a string from a message from the server if the server itself splits it with a semicolon?

var str = "2018-01-31 17:47:27;ул Лениена 29а;DOWN";
document.write(str.split(" "));

how to separate them after each semicolon?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Yarkov, 2018-02-01
@Zlatan77

Well, in split, instead of a space, pass a separator character

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question