好的,这是我的代码,其中包含我尝试执行的操作的详细信息:
var str = "Hello m|sss sss|mmm ss";
//Now I separate them by "|"
var str1 = str.split("|");
//Now I want to get the first word of every split-ed sting parts:
for (var i = 0; i < codelines.length; i++) {
//What to do here to get the first word of every spilt
}
那我应该在那里做什么?:\
我想要得到的是:
firstword[0]
会给"Hello"
firstword[1]
会给"sss"
firstword[2]
会给"mmm"