Home > Code > Javascript > Replace the string using JavaScript

Replace the string using JavaScript

by Narain Siddharth   on Dec 13, 2011   Category: Javascript   |  Views: 953    |  Points: 25   |  Silver 



Below JavaScript sample code shows how to replace the given string


<script type="text/javascript">

function ReplaceString()
{
var string1, string2;
string1 = "Replace string using C#";
string2 = string1.replace("C#", "JavaScript");
alert(string2);
}
</script>





Post Code  |  Code Snippet Home

User Responses


No response found, be the first to review this code snippet.

Submit feedback about this code snippet

Please sign in to post feedback

Latest Posts