Special symbol ~ conversion #936
-
symbol ~ List<string> prefixs = new List<string> { "~","#" };
var serializer = new SerializerBuilder();
var yamlContent = serializer.Build().Serialize(prefixs);
Console.WriteLine(yamlContent); output - ~
- '#' the symbol ~ cannot be deserialized is there any way to achieve the following effect - '~'
- '#' or ['~','#'] |
Beta Was this translation helpful? Give feedback.
Answered by
EdwardCooke
Jul 3, 2024
Replies: 2 comments 1 reply
-
There is. On your serializerbuilder call WithQuoteNecessaryStrings before Build. That should do what you want. |
Beta Was this translation helpful? Give feedback.
1 reply
-
Try using withquotenecessarystrings on your serializerbuilder. That should automatically add quotes around scalars that are numbers only. Along with other special values. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
EdwardCooke
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Try using withquotenecessarystrings on your serializerbuilder. That should automatically add quotes around scalars that are numbers only. Along with other special values.