REPLACE CHARACTERS OF A STRING
************************************************************************
W.A.P TO REPLACE CHARACTERS OF A STRING
************************************************************************
JAVA Program
Output:
************************************************************************
C Program
Online Compiler
************************************************************************
C++ Program
Online Compiler
************************************************************************
C# Program
************************************************************************
PHP Program
Php is a server side scripting language.
************************************************************************
JAVASCRIPT Program
<script type="text/javascript">
// var string = prompt("Enter a string: ");
var string = "Mr. Red has a red cap and a red book";
var reg =new RegExp('red','gi');
var newString = string.replace(reg,'blue');
console.log(newString);
</script>
************************************************************************
PYTHON Program
************************************************************************
Comments
Post a Comment