Skip to main content
Say What???
Ain't got a slogan...

Main menu

  • Home
  • Archived Articles

You are here

Home » Ruby 1.8 Method of the Day Archive

String.rstrip

Kelly McCauley's picture
published by Kelly McCauley on Wed, 10/27/2010 - 15:56

Signature

string.rstrip   #=> new_string

String.rstrip is the counter whitespace removal method to
String.lstrip.
string.rstrip returns a new string with trailing whitespace removed.

Examples

"foo bar  \r\n\t".rstrip    #=> "foo bar"

text = 

Documentation Reference

www.ruby-doc.org : String.rstrip

‹ String.rjust up String.rstrip! ›
  • Log in to post comments

Ruby 1.8 Method of the Day Archive

  • Array.&
  • Array.+
  • Array.-
  • Array.<< and Array.push
  • Array.[] and Array.slice
  • Array.[]=
  • Array.abbrev
  • Array.assoc
  • Array.compact and Array.compact!
  • Array.delete
  • Array.delete_if
  • Array.fetch
  • Array.first
  • Array.last
  • Array.map and Array.collect
  • Array.map! and Array.collect!
  • Array.nitems
  • Array.pop
  • Array.rassoc
  • Array.reject
  • Array.reject!
  • Array.slice!
  • Float.ceil
  • Float.floor
  • Float.truncate
  • Integer.downto
  • Integer.times
  • Integer.upto
  • String.%
  • String.*
  • String.+
  • String.<=>
  • String.==
  • String.=~
  • String.[]
  • String.[]=
  • String.casecmp
  • String.center
  • String.count
  • String.delete
  • String.delete!
  • String.gsub
  • String.gsub!
  • String.hex
  • String.index
  • String.insert
  • String.inspect
  • String.length
  • String.ljust
  • String.lstrip
  • String.lstrip!
  • String.next
  • String.reverse
  • String.rindex
  • String.rjust
  • String.rstrip
  • String.rstrip!
  • String.scan
  • String.strip
  • String.strip!
  • String.sub
  • String.to_sym

User login

  • Request new password

Syndicate

Subscribe to Syndicate

Content Copyright © Kelly McCauley, All Rights Reserved. Trademarks and copyrights are owned by their respective owners. Comments are owned by the commenter.