I want to compare two string. Is there existing diffrences in each index, i want to color that specific char in red (if not match) or green (if it match).
<li>
@for (int i = 0; i < item.AnswersList.Count; i++)
{
var answerArray = item.AnswersList[i].Output.ToArray();
var outputArray = item.OutputList[i].Output.ToArray();
for (int j = 0; j < answerArray.Length; i++)
{
if (answerArray[j] == outputArray[j])
{
@Html.Raw( How to print colorful char here?);
}
}
}
</li>
That colored string need to be in one line in <li> tag.
EDIT:
I made this edit to my code:
<div style="color: green;">
@Html.Raw(outputArray[j])
</div>
But i get output like that:
How to make it one word in <li> tag?
