Mam tablicę ciągów i muszę dodać hiperłącze do każdego pojedynczego dopasowania elementu w tablicy i podanego ciągu. Zasadniczo coś jak w Wikipedii.Jak zrobić programowo tekst HTML za pomocą hiperłączy jak w Wikipedii?
Coś jak:
private static string AddHyperlinkToEveryMatchOfEveryItemInArrayAndString(string p, string[] arrayofstrings)
{ }
string p = "The Domesday Book records the manor of Greenwich as held by Bishop Odo of
Bayeux; his lands were seized by the crown in 1082. A royal palace, or hunting lodge, has
existed here since before 1300, when Edward I is known to have made offerings at the chapel of the Virgin Mary.";
arrayofstrings = {"Domesday book" , "Odo of Bayeux" , "Edward"};
returned string = @"The <a href = "#domesday book">Domesday Book</a> records the manor of
Greenwich as held by Bishop <a href = "#odo of bayeux">Odo of Bayeux</a>; his lands were
seized by the crown in 1082. A royal palace, or hunting lodge, has existed here since
before 1300, when <a href = "#edward">Edward<a/> I is known to have made offerings at the
chapel of the Virgin Mary.";
Jaki jest najlepszy sposób to robić?
Wikipedia nie robi tego automatycznie. Musisz określić, gdzie znajdują się linki, nawet jeśli możesz to zrobić, używając prostego, konkretnego znacznika zamiast pełnego HTML. – GolezTrol