मेरे पास तारों की सरणी है और मुझे सरणी में दिए गए स्ट्रिंग के आइटम के प्रत्येक मैच में हाइपरलिंक जोड़ना होगा। मुख्य रूप से विकिपीडिया में कुछ पसंद है।विकिपीडिया जैसे हाइपरलिंक्स के साथ प्रोग्रामेटिक रूप से HTML टेक्स्ट कैसे बनाएं?
कुछ की तरह:
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.";
कि ऐसा करने का सबसे अच्छा तरीका क्या है?
विकिपीडिया स्वचालित रूप से ऐसा नहीं करता है। आपको यह निर्दिष्ट करना होगा कि लिंक कहां हैं, भले ही आप पूर्ण HTML के बजाय एक सरल, विशिष्ट मार्कअप कर सकें। – GolezTrol