Advertisement
Dudugz-Contistente

Untitled

Sep 21st, 2017
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. read={
  2. lines=function(string)
  3. string=string:gsub('<br>','\n'):gsub('</br>','')
  4. local lines={}
  5. for line in string.gmatch(string,'[^\n]+') do
  6. table.insert(lines,line)
  7. end
  8.  
  9. return lines
  10. end,
  11. }
  12.  
  13. edit={
  14. line=function(string,line,oldValue,newValue)
  15. local lines = read.lines(string)
  16. local str = ""
  17.  
  18. for _,value in pairs(lines) do
  19. if _ == line then
  20. str=str..value:gsub(oldValue,newValue).."\n"
  21. else
  22. str=str..value.."\n"
  23. end
  24. end
  25.  
  26. return str
  27. end
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement