summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBurdetteLamar <burdettelamar@yahoo.com>2025-10-13 17:33:03 +0100
committerPeter Zhu <peter@peterzhu.ca>2025-10-13 18:14:57 -0400
commit25821f3438fda08b54c7ff1702f0c87ffe6e7217 (patch)
tree9d7d0f1e6a6501bac9fd1a72de6f13e551059456
parent53ca9fbb4c9a307379b0647130564f2ef3ad07c7 (diff)
[DOC] Tweaks for String#rjust
-rw-r--r--doc/string/rjust.rdoc6
-rw-r--r--string.c2
2 files changed, 4 insertions, 4 deletions
diff --git a/doc/string/rjust.rdoc b/doc/string/rjust.rdoc
index 39e490b7cc..864cfcce7a 100644
--- a/doc/string/rjust.rdoc
+++ b/doc/string/rjust.rdoc
@@ -1,7 +1,7 @@
Returns a right-justified copy of +self+.
-If integer argument +size+ is greater than the size (in characters) of +self+,
-returns a new string of length +size+ that is a copy of +self+,
+If integer argument +width+ is greater than the size (in characters) of +self+,
+returns a new string of length +width+ that is a copy of +self+,
right justified and padded on the left with +pad_string+:
'hello'.rjust(10) # => " hello"
@@ -10,7 +10,7 @@ right justified and padded on the left with +pad_string+:
'тест'.rjust(10) # => " тест"
'こんにちは'.rjust(10) # => " こんにちは"
-If +size+ is not greater than the size of +self+, returns a copy of +self+:
+If <tt>width <= self.size</tt>, returns a copy of +self+:
'hello'.rjust(5, 'ab') # => "hello"
'hello'.rjust(1, 'ab') # => "hello"
diff --git a/string.c b/string.c
index a0369ecb55..fab1509bac 100644
--- a/string.c
+++ b/string.c
@@ -11177,7 +11177,7 @@ rb_str_ljust(int argc, VALUE *argv, VALUE str)
/*
* call-seq:
- * rjust(size, pad_string = ' ') -> new_string
+ * rjust(width, pad_string = ' ') -> new_string
*
* :include: doc/string/rjust.rdoc
*