tumblr tracker

Replace

Library Reference ›› String ››
Parent Previous Next

String.Replace


Namespace: String


Replaces all occurrences of a substring within a string with another string.


retval = String.Contains(Input, OldString, NewString)


Parameters:

- Input; string constant or variable or function returning a string; the string to search in

- OldString; string constant or variable or function returning a string; the string to search for in param1

- NewString; string constant or variable or function returning a string; the the new string to replace param2 with


Returns:

The new string whose param2 occurrences are replaced with param3; string value.


Example


$val = String.Replace("This is a test string.", "test", "new");


After execution the $val variable will contain This is a new string. value.