Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9210203
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T01:00:58+00:00 2026-06-18T01:00:58+00:00

I am relitively new to coding c# for web applications, but have some knowledge

  • 0

I am relitively new to coding c# for web applications, but have some knowledge in c#.

I am trying to read a text file (example below) and produce a webpage with format based on the characters used to seperate each line.

I’m sure there is a very simple way to do this, but this is what I have come up with. It works for my current intended purpose, but looks horrible and complicated.

The file I’m reading looks as follows:

^This ^is ^the ^home ^file.|*This is a ^bullet point.|*^This is another one.|This isn't a bullet point.

The code I have to read this and display it looks like this:

@{int bulletNum = 0;}
@foreach (string homeLine in homeData)
{
    foreach (string homeItem in homeLine.Split('|'))
    {
        if (homeItem.First()=='*')
        {
            bulletNum++;
            <ol class="round">
                <li class="num@(bulletNum)">
                    @foreach (string homeElementFirst in homeItem.Split(' '))
                    {
                        string homeElementSecond = homeElementFirst.TrimStart('*');
                        if (homeElementSecond.First() == '^')
                        {
                            <b>@homeElementSecond.TrimStart('^')</b>
                        }
                        else
                        {
                            @homeElementSecond <text> </text>
                        }
                    }
                </li>
            </ol>
        }
        else
        {
            foreach (string homeElement in homeItem.Split(' '))
            {
                if (homeElement.First() == '^')
                {
                    <b>@homeElement.TrimStart('^')</b>
                }
                else
                {
                    @homeElement <text> </text>
                }
            }
        }
        <br />
    }
}

Please excuse my terrible variable names.

Can anyone help tidy this up for me? Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T01:01:00+00:00Added an answer on June 18, 2026 at 1:01 am

    It looks like you’re trying to implement a custom markup language, albeit a simple one. I would recommend that you use an existing library for this sort of thing. Check out Textile, which does something similar. There’s a C# port of Textile available.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i am relatively experienced in Java coding but am new to C++. I have
I'm relatively new to coding and have tried searching for a solution, but am
Im relatively new to the Android world but I have a quick question. I
I'm relatively new to coding, and wondering if there's a conventional way to have
I am relatively new to Android programming, but have had experience in Java and
I'm relatively new to java (specifically swing) and have recently been making some fairly
I am relatively new to IPhone coding, although I have reached the point of
I am relitively new to Apache Ivy and am trying to move an existing
Am relatively new to C# and coding in general. I am trying to write
I'm relatively new to coding so please help me out here. The code will

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.