Skip to content

Commit 55dd202

Browse files
BurdetteLamarpeterzhu2118
authored andcommitted
[DOC] Tweaks for String#delete_prefix!
1 parent d38bb4a commit 55dd202

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

doc/string.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,7 @@
427427
# - #slice!, #[]=: Removes a substring determined by a given index, start/length, range, regexp, or substring.
428428
# - #squeeze!: Removes contiguous duplicate characters; returns +self+.
429429
# - #delete!: Removes characters as determined by the intersection of substring arguments.
430+
# - #delete_prefix!: Removes leading prefix; returns +self+ if any changes, +nil+ otherwise.
430431
# - #lstrip!: Removes leading whitespace; returns +self+ if any changes, +nil+ otherwise.
431432
# - #rstrip!: Removes trailing whitespace; returns +self+ if any changes, +nil+ otherwise.
432433
# - #strip!: Removes leading and trailing whitespace; returns +self+ if any changes, +nil+ otherwise.

string.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11300,9 +11300,10 @@ deleted_prefix_length(VALUE str, VALUE prefix)
1130011300
* call-seq:
1130111301
* delete_prefix!(prefix) -> self or nil
1130211302
*
11303-
* Like String#delete_prefix, except that +self+ is modified in place.
11304-
* Returns +self+ if the prefix is removed, +nil+ otherwise.
11303+
* Like String#delete_prefix, except that +self+ is modified in place;
11304+
* returns +self+ if the prefix is removed, +nil+ otherwise.
1130511305
*
11306+
* Related: see {Modifying}[rdoc-ref:String@Modifying].
1130611307
*/
1130711308

1130811309
static VALUE

0 commit comments

Comments
 (0)