Is it possible to format a specific part of a string? I'm trying to only stylize the word within quotation marks.
This is my cshtml code:
{
<div class="h-44 overflow-auto text-left mx-4 mb-4">
<p id="countError" class=" main-text-color mb-2 w-[70%] font-semibold">@Model.ToString().Replace("|", " ")</p>
<p class="main-text-color">The following errors occurred:</p>
@foreach (var error in Model.Errors)
{
var errors = error.Split(Environment.NewLine);
bool firstLine = true;
foreach (var item in errors)
{
if (firstLine)
{
<p class="leading-8 text-red-500 font-spec-bold">
@Html.Raw(item)
</p>
firstLine = false;
}
else
{
<p id="teste" class=" leading-8 main-text-color ">
@Html.Raw(item);
</p>
}
}
}
</div>
}
Here's an example of what I'm looking for:
The original string is like this:
I want to emphasize this "WORD" with bold styling.
I'd like it to look like this:
I want to emphasize this "WORD" with bold styling.
Thank you!
I couldn't find a similar example here, but any guidance would be greatly appreciated.