replace()

Description :

This method finds search string and replaces with given replace string. To replace all the occurences found in the given string, you can use regular expression

Syntax :

string.replace(FindString, ReplaceString)

Input Parameters :

FindString
String to be searched in the given string. Use regular expression if you want to replace all the occurences which are matched.

ReplaceString
The string to be replaced with matched string

Return Values :

This method returns the new string which is replaced by replace string for the matched string.

This method does not change the original string value from where they are calling. In order to get the value, the return value should be assigned to some other variable


Test this method :

Regular Expression Search (e.g. /u/g, /u/gi)
Test Result :   
Your Code :