Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function stringDel(source,delString)
- local stringPos={string.find(source,delString)}
- source=string.sub(source,1,stringPos[1]-1)..string.sub(source,stringPos[2]+1)
- return(source)
- end
- function commentToFile(fileName)
- txt=fs.open(fileName,'r').readAll()
- while string.find(txt,'--[$') do
- str1={string.find(txt,'--[$')}
- txt=stringDel(txt,'--[$')
- str2={string.find(txt,'$')}
- newFile=string.sub(txt,str1[1],str2[1]-1)
- stringDel(txt,newFile..'$')
- str3={string.find(txt,'$'..newFile..'$')}
- result=string.sub(txt,str1[1],str3[1]-1)
- fp=fs.open(fileName,'w')
- fp.write(result)
- fp.close()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement