Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function indent( message, nbrChar, first )
- local strTbl = string.Explode( "", message )
- for i=nbrChar,#strTbl,nbrChar do
- if strTbl[i] == " " then
- strTbl[i] = "\n"
- else
- for k=i,1,-1 do
- if strTbl[k] == " " then
- strTbl[k] = "\n"
- break
- end
- end
- end
- end
- if first then
- return string.Explode("\n", table.concat(strTbl))
- else
- return table.concat(strTbl)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement