summaryrefslogtreecommitdiff
path: root/string.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-02-12 10:57:22 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-02-12 10:57:22 +0000
commit8cdd45d15be79f0232b38b82074344e52baa4d85 (patch)
tree58bca88a6f85806d865a747f5baa573c93a1c74c /string.c
parent8a0968895796cbe9b9cd5ffa4f555f6b91b87e03 (diff)
* ext/etc/etc.c (Init_etc): sGroup needs HAVE_ST_GR_PASSWD check.
[ruby-dev:25675] * misc/ruby-mode.el: [ruby-core:04415] * lib/rdoc/generators/html_generator.rb: [ruby-core:04412] * lib/rdoc/generators/ri_generator.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@7953 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'string.c')
-rw-r--r--string.c29
1 files changed, 16 insertions, 13 deletions
diff --git a/string.c b/string.c
index 0f932a6b5e..42fb4a0af9 100644
--- a/string.c
+++ b/string.c
@@ -4531,14 +4531,15 @@ rb_str_justify(argc, argv, str, jflag)
/*
* call-seq:
- * str.ljust(integer) => new_str
+ * str.ljust(integer, padstr=' ') => new_str
*
* If <i>integer</i> is greater than the length of <i>str</i>, returns a new
* <code>String</code> of length <i>integer</i> with <i>str</i> left justified
- * and space padded; otherwise, returns <i>str</i>.
+ * and padded with <i>padstr</i>; otherwise, returns <i>str</i>.
*
- * "hello".ljust(4) #=> "hello"
- * "hello".ljust(20) #=> "hello "
+ * "hello".ljust(4) #=> "hello"
+ * "hello".ljust(20) #=> "hello "
+ * "hello".ljust(20, '1234') #=> "hello123412341234123"
*/
static VALUE
@@ -4553,14 +4554,15 @@ rb_str_ljust(argc, argv, str)
/*
* call-seq:
- * str.rjust(integer) => new_str
+ * str.rjust(integer, padstr=' ') => new_str
*
* If <i>integer</i> is greater than the length of <i>str</i>, returns a new
* <code>String</code> of length <i>integer</i> with <i>str</i> right justified
- * and space padded; otherwise, returns <i>str</i>.
+ * and padded with <i>padstr</i>; otherwise, returns <i>str</i>.
*
- * "hello".rjust(4) #=> "hello"
- * "hello".rjust(20) #=> " hello"
+ * "hello".rjust(4) #=> "hello"
+ * "hello".rjust(20) #=> " hello"
+ * "hello".rjust(20, '1234') #=> "123412341234123hello"
*/
static VALUE
@@ -4575,14 +4577,15 @@ rb_str_rjust(argc, argv, str)
/*
* call-seq:
- * str.center(integer) => new_str
+ * str.center(integer, padstr) => new_str
*
* If <i>integer</i> is greater than the length of <i>str</i>, returns a new
- * <code>String</code> of length <i>integer</i> with <i>str</i> centered
- * between spaces; otherwise, returns <i>str</i>.
+ * <code>String</code> of length <i>integer</i> with <i>str</i> centered and
+ * padded with <i>padstr</i>; otherwise, returns <i>str</i>.
*
- * "hello".center(4) #=> "hello"
- * "hello".center(20) #=> " hello "
+ * "hello".center(4) #=> "hello"
+ * "hello".center(20) #=> " hello "
+ * "hello".center(20, '123') #=> "1231231hello12312312"
*/
static VALUE