© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•4y ago•
3 replies
Doombox

Correctly reading tabs from text file. [Answered]

I have some Markdown files that are just this
- Some Item
  - Some Tabbed Item
- Some Item
  - Some Tabbed Item

and I'm reading them like this
if (!SemanticVersion.TryParse(file[path.Length..^3], out var semVer)) continue;
await using var stream = _assembly.GetManifestResourceStream(file);
if (stream is null) continue;
using var reader = new StreamReader(stream);
changelogs.Add(semVer, await reader.ReadToEndAsync());
if (!SemanticVersion.TryParse(file[path.Length..^3], out var semVer)) continue;
await using var stream = _assembly.GetManifestResourceStream(file);
if (stream is null) continue;
using var reader = new StreamReader(stream);
changelogs.Add(semVer, await reader.ReadToEndAsync());

however the tabbed items are having their tabs stripped from them and the output is just a bunch of strings split by
\r\n
\r\n
, not sure how I'm supposed to read it correctly to preserve the tabs
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

❔ Reading data from a text file
C#CC# / help
4y ago
Reading Formatted .txt File [Answered]
C#CC# / help
4y ago