| ZennoLab.Macros Assembly > ZennoLab.Macros Namespace > TextProcessing Class : Replace Method |
Type: System.String
The source string.
Type: System.String
The string to be replaced.
Type: System.String
The string to replace occurrences of find.
Type: System.String
The type of the search find. It can have the following values: Text or Regex.
Type: System.String
The type of the performance of replacing in String object. It can have the following values: All, First, Last, Number or Range.
Type: System.String
The additional parameter for search. This parameter applies only for Number and Range values of take. Default value is empty string. In Number case it must be number of the occurrence in string value, in Range case it must be the range of the occurrences.
public static string Replace( string sourceString, string find, string replace, string searchType, string take, string parameters )
Type: System.String
The source string.
Type: System.String
The string to be replaced.
Type: System.String
The string to replace occurrences of find.
Type: System.String
The type of the search find. It can have the following values: Text or Regex.
Type: System.String
The type of the performance of replacing in String object. It can have the following values: All, First, Last, Number or Range.
Type: System.String
The additional parameter for search. This parameter applies only for Number and Range values of take. Default value is empty string. In Number case it must be number of the occurrence in string value, in Range case it must be the range of the occurrences.
Type: System.String
A string that is equivalent to the current string except that instances of find are replaced with replace.
// replace "this" in string to "new value" string newString = Macros.TextProcessing.Replace("replace this to new value", "this", "new value", "Text", "First");
// replace "this" in string to "new value" $newString = Macros::TextProcessing::Replace("replace this to new value", "this", "new value", "Text", "First");
Target Platforms: Desktop: Windows XP SP3 and older. Server: Windows Server 2003 and older.