D
Deklein
Guest
So I've been working with some included text files, along with additional text files I create in-game.
I've run into a bit of an issue, however, and I'm unsure how to resolve it.
I have one text file in particular that basically contains a list of items, one item on each line, similar to the block below:
Anyways, I have some code to parse the file and store each line into an array.
Code for reference:
Now this code has been working great; I've been able to pull each item from the file no problem. However, I ran into an issue when creating a new string making use of the item I pulled.
When displaying the variable newString, I expect the following:
"Item2 plus more stuff"
However, I instead get
"Item2
plus more stuff"
It seems to me that when I store each line and therefore each item, the line break after each item is also stored. When I go to use this information, it also puts in a line break!
I don't want it to do this but haven't found anything yet on how to stop this from happening.
I feel like I'm missing something obvious.
I've run into a bit of an issue, however, and I'm unsure how to resolve it.
I have one text file in particular that basically contains a list of items, one item on each line, similar to the block below:
Code:
Item1
Item2
Item3
...
Item62
Code for reference:
Code:
var num = 0;
while (!file_text_eof(file))
array[num++] = file_text_readln(file);
Code:
//for this example, "array[2]" is Item2
newString = array[2] + " plus more stuff";
"Item2 plus more stuff"
However, I instead get
"Item2
plus more stuff"
It seems to me that when I store each line and therefore each item, the line break after each item is also stored. When I go to use this information, it also puts in a line break!
I don't want it to do this but haven't found anything yet on how to stop this from happening.
I feel like I'm missing something obvious.