method
center
![Moderate documentation Importance_2](https://d2vfyqvduarcvs.cloudfront.net/images/importance_2.png?1349367920)
center(...)
public
Register or
log in
to add new notes.
WedTM -
February 11, 2010 - (v1_8_7_72)
![Default_avatar_30](https://www.gravatar.com/avatar/cce6dedd189d53eea48e6121bb9a0383?default=http://apidock.com/images/default_avatar_30.png&size=30)
0 thanks
Odd Number of padding characters
In the case of an odd number of empty spaces in a length, Ruby will append the extra character to the right-hand side of the string.
Example:
irb(main):002:0> "Hello".center(10,"-") => "--Hello---"