Replace message at position x to y
Hi,
I have a message. e.g.:
"I have a nice cat"
Now I want to replace a part of the message from x to y. - e.g: 10-15:
"I have a nice hat"
How can I do that? I can't find any objects that are related to messages or the string length.
Thanks!
Take a look at [regexp], [sprintf] and [combine].
Thanks. Are you sure that regexp works? I can only see examples of regexp, where the message structure is known in advance.
I don't know the structure of the message, because it is more or less random (the user can enter a message). - I only know the position, where I want to replace and how much i want to replace.
Got it! - without regex and sprintf :)
I'm not an expert with [regexp] and I'm sure there's a more elegant solution than this one, but here's a little hack that might do the job using [zl] and [atoi]:
I found the solution already and your solution isn't exactly what I wanted. But thanks! :)