Merge pull request #51234 from akien-mga/tests-file-get_csv_line
Tests: Improve coverage for `File::get_csv_line()`
This commit is contained in:
commit
faad8833fe
4 changed files with 57 additions and 25 deletions
|
|
@ -119,8 +119,15 @@
|
|||
<return type="PackedStringArray" />
|
||||
<argument index="0" name="delim" type="String" default="","" />
|
||||
<description>
|
||||
Returns the next value of the file in CSV (Comma-Separated Values) format. You can pass a different delimiter [code]delim[/code] to use other than the default [code]","[/code] (comma). This delimiter must be one-character long.
|
||||
Text is interpreted as being UTF-8 encoded.
|
||||
Returns the next value of the file in CSV (Comma-Separated Values) format. You can pass a different delimiter [code]delim[/code] to use other than the default [code]","[/code] (comma). This delimiter must be one-character long, and cannot be a double quotation mark.
|
||||
Text is interpreted as being UTF-8 encoded. Text values must be enclosed in double quotes if they include the delimiter character. Double quotes within a text value can be escaped by doubling their occurrence.
|
||||
For example, the following CSV lines are valid and will be properly parsed as two strings each:
|
||||
[codeblock]
|
||||
Alice,"Hello, Bob!"
|
||||
Bob,Alice! What a surprise!
|
||||
Alice,"I thought you'd reply with ""Hello, world""."
|
||||
[/codeblock]
|
||||
Note how the second line can omit the enclosing quotes as it does not include the delimiter. However it [i]could[/i] very well use quotes, it was only written without for demonstration purposes. The third line must use [code]""[/code] for each quotation mark that needs to be interpreted as such instead of the end of a text value.
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_double" qualifiers="const">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue