Hi c.pfaffenbichler, Thanks for the reply,
Yes I tried this
var theArray = theText.split("\r");
but this works only when there is only an Enter after end of lines or you can say when the line terminates with Enter key only.
This case fails when the line terminates with Shift+Enter key.