
In my requirement i have two strings (Dynamically) i want to compare two strings and strike off the deleted/modified string and also highlight the newly added string. one string is my old string and one string is new string, some times both are same based on user input. i tried but i cant get output. please help me. below is my tried code in c#
Ex: string s1 = "Hello dear Alice and dear Bob.";string s2 = " Hello Alice and dear Bob Have a nice day.";
Need Output: Hello dear Alice and dear Bob Have a nice day. Dear is strike off and Have a nice day is highlight. pLEASE help me friends My code:
if(String.Equals(my_NString,my_String,StringComparison.OrdinalIgnoreCase))
{
sb.AppendLine("<div><p style='text-align:justify;'>"+my_NString+" </p></div>");
sb.AppendLine("<br/>");
}
else
{
sb.AppendLine("<p style='text-align:justify;border:3px;border-color:#FF0000;padding:1em;color:red;'>"+my_NString+" </p>");
sb.AppendLine("<br/>");
}
}