PtokaX forum

Archive => Archived 4.0 boards => Request for Lua 4 scripts => Topic started by: charlie on 17 August, 2004, 11:11:47

Title: help with txt
Post by: charlie on 17 August, 2004, 11:11:47
hi...

i use a script with timer function to read things out of a txt file which is generated from a other programm...

is there a way before output started to replace characters in other characters in the txt file?

for example: replace all "on" into "-"

thx for help
Title:
Post by: plop on 17 August, 2004, 11:26:26
here is a snippe and example in 1.
function ReplaceChars(string, old, new)
   string = gsub(string, old, new)
   return string
end

text = "it's on"

text = ReplaceChars(text, "on", "-")

print(text)

plop
Title:
Post by: charlie on 17 August, 2004, 11:55:15
great


thx
Title:
Post by: plop on 17 August, 2004, 13:07:11
yw

plop