The following script will change the URL in the browser address bar. This includes updating the title and the link.
<script type="text/javascript">
function ChangeUrl(title, url) {
if (typeof (history.pushState) != "undefined") {
var obj = { Title: title, Url: url };
history.pushState(obj, obj.Title, obj.Url);
} else {
alert("Browser does not support HTML5.");
}
}
ChangeUrl("Title", "Link");
</script>
To decode HTML you can use HttpUtility.HtmlDecode
string a = "Here's how to";
string b = HttpUtility.HtmlDecode(a);
Response.Write(b);
This will output
Here's how to
If you are using .NET 4.0+ you can also use WebUtility.HtmlDecode
which does not require an extra assembly reference as it is available in the System.Net
namespace.
C# String.StartsWith() method determines whether this string instance starts with the specified character or string.
String.StartsWith(ch)
String.StartsWith(str)
String.StartsWith(str, ignoreCase, culture)
String.StartsWith(str, comparisonType)