Advertisement
Pinkishu

Untitled

Aug 12th, 2012
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.34 KB | None | 0 0
  1.     local wLine = "i love you my friend"
  2.     local startPos = 3
  3.     local sX = startPos
  4.     local str = "hate"
  5.     local pre = ""
  6.     if sX > 1 then
  7.         pre = string.sub(wLine,1,sX-1)
  8.     end
  9.     local post = ""
  10.     sX = startPos + string.len(str)
  11.     if sX <= 30 then
  12.         post= string.sub(wLine,sX)
  13.     end
  14.     local newLine = string.sub(pre..str..post,1,30)
  15.     print(newLine)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement