[Solved] Replace the particular part of string? [closed]

[ad_1]

You can do this:

var str = "asp,mvc,c#,wpf";
var anotherStr = "<b>asp</b>,<b>wpf</b>";
var myArr = anotherStr.Replace("<b>", "").Replace("</b>", "").Split(',');
foreach (string value in myArr)
{
    str = str.Replace(value, "<b>" + value + "</b>");
}
Console.WriteLine(str);

2

[ad_2]

solved Replace the particular part of string? [closed]