store_line() adds dot at the end of a string

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By paxetgloria

Hi, I’m trying to get my head around store_line(). If I do,

var file = File.new()
file.open("res://test.txt", File.WRITE)
file.store_line("Hello World")
file.close()

script writes “Hello World.”(with dot at the end) into the file.
If I call file.store_line(“Hello World”) twice,

var file = File.new()
file.open("res://test.txt", File.WRITE)
file.store_line("Hello World")
file.store_line("Hello World")
file.close()

the output is:

Hello World
Hello World

Is this a bug or a feature?

:bust_in_silhouette: Reply From: shmellyorc

store line, basically means what it does. stores a line of string datatype with char return. if using notepad, it may show the character return as ‘dot’.

imo: if it displays your text properly, the file you write loads up properly with no extra characters, their should be nothing to worry about.

@shmellyorc , but why it doesn’t do it for every store_line() call then? That was actually my point.

paxetgloria | 2020-07-12 20:07