summaryrefslogtreecommitdiff
path: root/string.c
diff options
context:
space:
mode:
authorMarcus Stollsteimer <sto.mar@web.de>2020-01-08 20:53:31 +0100
committerMarcus Stollsteimer <sto.mar@web.de>2020-01-08 20:53:31 +0100
commit1d09acd82bc90c0794c0409e330ecc71a912d1b3 (patch)
treeda385842ddffa45fc5649fa022b095fcc2eff1a0 /string.c
parent841a945d63f0662b6eae7761b951e0ddc2d94553 (diff)
[DOC] Improve docs for String#match
Fix invalid code to make it syntax highlighted; other small fixes.
Diffstat (limited to 'string.c')
-rw-r--r--string.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/string.c b/string.c
index af02cdde51..2413fbf8fc 100644
--- a/string.c
+++ b/string.c
@@ -3831,9 +3831,9 @@ static VALUE get_pat(VALUE);
* str.match(pattern, pos) -> matchdata or nil
*
* Converts <i>pattern</i> to a Regexp (if it isn't already one),
- * then invokes its <code>match</code> method on <i>str</i>. If the second
- * parameter is present, it specifies the position in the string to begin the
- * search.
+ * then invokes its <code>match</code> method on the receiver.
+ * If the second parameter is present, it specifies the position
+ * in the string to begin the search.
*
* 'hello'.match('(.)\1') #=> #<MatchData "ll" 1:"l">
* 'hello'.match('(.)\1')[0] #=> "ll"
@@ -3841,18 +3841,18 @@ static VALUE get_pat(VALUE);
* 'hello'.match(/(.)\1/, 3) #=> nil
* 'hello'.match('xx') #=> nil
*
- * If a block is given, invoke the block with MatchData if match succeed, so
- * that you can write
+ * If a block is given, invokes the block with MatchData if match succeeds,
+ * so that you can write
*
- * str.match(pat) {|m| ...}
+ * str.match(pat) {|m| block }
*
* instead of
*
* if m = str.match(pat)
- * ...
+ * # ...
* end
*
- * The return value is a value from block execution in this case.
+ * The return value in this case is the value from block execution.
*/
static VALUE