var string = "Hello word;\nI love Jscript\nЯ ненавижу php"; var line = 2; alert( string.split(/[\n\r]+/)[line - 1] );