diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2021-08-06 10:17:12 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-06 10:17:12 +0200 |
commit | faad8833fe8144ef8d79d4d6b7f46bb059c6cda5 (patch) | |
tree | 68646aa010f90d1058d6a42f478820a77b0c7683 /doc/classes | |
parent | 6ded4f52e8c2d48b98b631a1ec8ab5be8aa4768a (diff) | |
parent | b8c08ba5add1406783cec2333d6ad7011a29e01f (diff) |
Merge pull request #51234 from akien-mga/tests-file-get_csv_line
Tests: Improve coverage for `File::get_csv_line()`
Diffstat (limited to 'doc/classes')
-rw-r--r-- | doc/classes/File.xml | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/doc/classes/File.xml b/doc/classes/File.xml index de3beedf0f..6622619fb3 100644 --- a/doc/classes/File.xml +++ b/doc/classes/File.xml @@ -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"> |