RSub
Inherits Reference < Object
Constructors
new(string : String)
SourceInstance methods
gsub(string substring, &block : -> String)
Returns a String where all occurrences of the given string are replaced with the block’s value, starting from the RHS.
Example:
stack = ["a", "b"]
RSub.new("{} {}").gsub("{}") do stack.pop end
⇒ a b
string
Sourcestring=(string : String)
Sourcesub(string substring, &block : -> String)
Returns a String where the last occurrence of the given string is replaced with the block’s value.
Example:
stack = ["a", "b"]
RSub.new("{} {}").sub("{}") do stack.pop end
⇒ {} b