[RESOLVED] WriteAllText: append with a space, multiple variables
Hi all.
I am using the below code to write to a file. Each time this code is used, it appends to the file, with no space between the old and new entry.
1. How can I append with a space between the two entries?
2. What about writing multiple variables? If I have two variables, NewEvent1 & NewEvent2, how can I write both to the file, with a comma between them?
EDIT: Forgot to mention that I want to separate with a comma because I want to read the variables back from the file. So the comma is a delimiter.
Thanks in advance.
Code:
My.Computer.FileSystem.WriteAllText("events.txt", NewEvent, True)
Re: WriteAllText: append with a space, multiple variables
You're not really thinking about this logically. The code you're using appends the contents of a String to a file. Whatever you want to append to the file, you put in that String. If you want to append a space followed by some text then you put a space followed by some text in a String. If you want to append some text followed by a comma followed by some more text then you put some text followed by a comma followed by some more text into a String. How do you usually join multiple Strings together into one? That's exactly what you do here.