SamboyCoding / Tomlet

Zero-Dependency, model-based TOML De/Serializer for .NET

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Suggestion] String serialization

levicki opened this issue · comments

Please consider serializing strings that contain \ character as string literals (i.e. with single quotes):

FolderPath = 'C:\Path\To\Folder'

Currently they are escaped then serialized with regular double quotes.

Furthermore, if the strings contain newline characters (probably also taking into account Unicode newlines, not just \r and \n), they could be serialized using multi-line literals:

lines = '''
The first newline is
trimmed in raw strings.
All other whitespace
is preserved.
'''

If you want to avoid scanning strings and doing any auto-detection, then having some control over how string values are serialized would be nice.

Thanks for implementing this.