如何在行中查找点,然后在新行中添加内容后

问题描述

现在我的内容是一行,但是我想新的内容是point(。)之后的新行

enter image description here

.cs

        [HttpGet]
        public async Task<ActionResult> Career()
        {
            HttpClient client = new HttpClient();
            HttpResponseMessage responseMessage = client.GetAsync("https://localhost:0000/Home/displayVacancyData").Result;

            if (responseMessage.IsSuccessstatusCode)
            {
                //data = await responseMessage.Content.ReadAsAsync();
                //List<Vacancy> products = await responseMessage.Content.ReadAsAsync<List<Vacancy>>();
                string result = await responseMessage.Content.ReadAsstringAsync();
                List<Vacancy> vaca = JsonConvert.DeserializeObject<List<Vacancy>>(result);
                ViewBag.message = vaca + "<br />";
                return View("Career",vaca);
                 
            }
            return View();
        }

.cshtml

<table class="table table-striped border">
    <thead>
        <tr>
            <th>Vacancy Title</th>
            <th>Vacancy Position</th>
            <th>Vacancy Experience</th>
            <th>Vacancy Jobdescription</th>
            <th>Vacancy requiredSkil</th>
            <th>Action</th>
        </tr>
    </thead>

    <tbody>
        @foreach (var carr in Model)
        {
            //string newline = "\n";

            <tr>
                <td>@carr.vacancytitle</td>
                <td>@carr.vacancyposition</td>
                <td>@carr.vacancyexperience</td>

                @*if()*@

                <td>@carr.vacancyjobdescription@*<text> & nbsp;</ text >*@</td>
                <td>@carr.vacancyrequiredskill</td>
                <td>
                    @Html.ActionLink("Apply for Job","ApplyForJob")
                </td>
            </tr>
        }
    </tbody>
</table>

是指将新内容放在单独的行中

逻辑首先在行中找到point(。),然后在添加新行之后

string newline = "\n";
if(carr.vacancyjobdescription)
{   
   //issue is here how to find out point in line
   and then add a <text>newline</text>
   
}

我正在尝试-主要问题是如何找到要点

               <td>
                    @if (carr.vacancyjobdescription != null)
                    {
                        @carr.vacancyjobdescription
                        <text>&nbsp;</text>
                    }
                </td>

解决方法

@{string data = "Hello. This is Test. Yo";
data= data.Replace(".","</br>");}


@*Then to display your value  use...*@
@Html.Raw(data)
,
    <td>

        @{
            string skillHtml = @carr.vacancyrequiredskill;
            skillHtml = skillHtml.Replace(".","</br>");
        }
        @*Here we gonna display the html*@
        @Html.Raw(skillHtml)
    </td>