Hi, nice and interesting forum which has helped me already a lot. But there is something I don't seem to find...
I want to add text to a string in a textfile. So let's say I receive a file called "text.txt", containing a string which always starts with "message :" The following words are variable, so I don't really know the message
SO, Message: Hello how are you doing?
I would like to add a Word to that message. The result should be something like this: "Message : Hello how are you doing? by Ingmar"
I found the replace function, but I don't know how to use it with a variable string. Can anybody help me, by giving some basic code are some terms I could search for?
You don't need the Replace function. If it's always just one line then read the file into a variable and append whatever you want to the end of it using the ampersand operator.
Ok, tnx. But how can I read in just thát line that starts with the word "Message" ? The text file contains other data as well? So there's more than 1 line.
Edit: I just found this code:
But I don't know how to store the whole message in a variable and then use it in a ".WriteLine" function. When I try this: it gives me a file with 'Message = ...' and it should be the whole message
< Message edited by ingmar -- 9/9/2008 5:57:06 AM >