所以我有一段字符串,需要按句点分隔。我如何得到前2句话?
这是我所拥有的:
var text="Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus."
text.split(".");
for (i=0;i <2;i++) {
//i dont know what to put here to get the sentence
}