Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Write a program that replaces in a HTML document given as string all the tags <a href="…">…</a>
- //with corresponding tags [URL=…]…/URL].
- using System;
- using System.Collections.Generic;
- using System.Text;
- class ChangeTheTagsInHTMLDocument
- {
- static void Main()
- {
- string input = @"<p>Please visit <a href=""http://academy.telerik. com"">our site</a> to choose a training course. Also visit <a href=""www.devbg.org"">our forum</a> to discuss the courses.</p>";
- string resultText = input.Replace("<a href=\"", "[URL=").Replace("</a>","[/URL]").Replace("\">","]");
- Console.WriteLine(input);
- Console.WriteLine("\nThe result after exchange :\n");
- Console.WriteLine(resultText);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement