Click or drag to resize

RegExSub Method

Searches the text for the compiled pattern and replaces it with the specified string. Escapes and backreferences such as $1 and $name are expanded and resolved. By default, only the first instance is replaced, but it can be changed for all instances (global replacement). The region to search within can be specified without modifying where the start and end anchor would be.

Namespace:  Godot
Assembly:  GodotSharp (in GodotSharp.dll) Version: 1.0.0
Syntax
C#
public string Sub(
	string subject,
	string replacement,
	bool all = false,
	int offset = 0,
	int end = -1
)

Parameters

subject
Type: SystemString

[Missing <param name="subject"/> documentation for "M:Godot.RegEx.Sub(System.String,System.String,System.Boolean,System.Int32,System.Int32)"]

replacement
Type: SystemString

[Missing <param name="replacement"/> documentation for "M:Godot.RegEx.Sub(System.String,System.String,System.Boolean,System.Int32,System.Int32)"]

all (Optional)
Type: SystemBoolean

[Missing <param name="all"/> documentation for "M:Godot.RegEx.Sub(System.String,System.String,System.Boolean,System.Int32,System.Int32)"]

offset (Optional)
Type: SystemInt32

[Missing <param name="offset"/> documentation for "M:Godot.RegEx.Sub(System.String,System.String,System.Boolean,System.Int32,System.Int32)"]

end (Optional)
Type: SystemInt32

[Missing <param name="end"/> documentation for "M:Godot.RegEx.Sub(System.String,System.String,System.Boolean,System.Int32,System.Int32)"]

Return Value

Type: String

[Missing <returns> documentation for "M:Godot.RegEx.Sub(System.String,System.String,System.Boolean,System.Int32,System.Int32)"]

See Also