✅ My stringbuilder is skipping lines
Aside from a previous post I made: https://discord.com/channels/143867839282020352/1105409576586715166/1105409576586715166
I am trying to parse some strings lines, but the stringbuilder itself is already skipping lines and I'm not entirely sure why it skips those lines.
The builder part (see the
stream
variable later):
The stream
variable:
And what I get in the console is the following:
So my stringbuilder already fails 😅
I get more when I just do reader.ReadToEnd().Replace("---", "").Trim()
but that will skip the body which could come after the last "---"
part.
So I need a way to include the body as well11 Replies
malkav#9104
So I have this
.md
to .yaml
parser written, and a package that parses a yaml into a .NET object class, however it keeps telling me the properties cannot be found.
For example, when I parse with the example class shown in https://dotnetfiddle.net/k1d6I2 my fiddle.
The method I use for parsing is in there too.
However, when I try to parse a markdown file:
I get the following error:
Can anyone help me out here? Or is there an easier way to parse .md files into JSON instead? (not using a console application, like this git linkhttps://github.com/markjulmar/MarkdownToJsonQuoted by
<@!258102980778262528> from #Familiarity with
YamlDotNet
package, parsing to strongly typed object keeps failing (click here)React with ❌ to remove this embed.
looks like it skips a line on every line it reads
is this the whole code?
Yes, I think I included a fiddle
Oops, no
Let me make a fiddle on the whole code
C# Online Compiler | .NET Fiddle
Test your C# code online with .NET Fiddle code editor.
i can see why
Why?
lol yeah
ur calling ReadLine twice in the while loop
you
AppendLine
await reader.ReadLineAsync()
instead of line
and you never used the line variable
change to
ofc... I feel like an idiot now lol
Yarp, that fixed everything 🤣
You guys are my heroes of today!
Thanks!