Advertisement
Guest User

Untitled

a guest
Jan 30th, 2015
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. var value='1. Первая строка,
  2. 2. Вторая строка, текс, текст
  3. 3. Третья строка, текст.... текст!!!;":',
  4. split=value.split("\n"),
  5. join=[];
  6. split.forEach(function(value) {
  7. if($.trim(value)) {
  8. join.push($.trim(value.toLowerCase().replace(/[^0-9a-zа-я\s]/g,'').replace(/\s+/g,' ')));
  9. }
  10. });
  11. value=$.trim(join.join("\n")).replace(/\n{2,}/,"\n");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement