How to trim a string in js?

Hello! Please tell me the following, there is a line:
0800, g Ahh, Ahh building, room 111

By js can be divided into different rows/variables:
0800 and G. Ahh, Ahh building, room 111
July 9th 19 at 13:07
2 answers
July 9th 19 at 13:09
Solution
var str = "0800, g Ahh, Ahh building, room 111";
str = str.split(',');
str = str.shift()+' and'+ str.join()
alert(str);
Thank you! - Malvina.Robel23 commented on July 9th 19 at 13:12
: Please Novel! - dannie_Schmidt commented on July 9th 19 at 13:15
July 9th 19 at 13:11
var str = "a, b, c";
var arr = str.split(", ");
console.log(arr); // ["a", "b", "c"]

Find more questions by tags JavaScript