D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
proc
/
self
/
root
/
opt
/
alt
/
ruby34
/
share
/
ri
/
system
/
String
/
Filename :
chomp-i.ri
back
Copy
U:RDoc::AnyMethod[iI" chomp:ETI"String#chomp;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"XReturns a new string copied from +self+, with trailing characters possibly removed:;To:RDoc::Markup::BlankLine o; ; [I"NWhen +line_sep+ is <tt>"\n"</tt>, removes the last one or two characters ;TI"Bif they are <tt>"\r"</tt>, <tt>"\n"</tt>, or <tt>"\r\n"</tt> ;TI"(but not <tt>"\n\r"</tt>):;T@o:RDoc::Markup::Verbatim; [I"%$/ # => "\n" ;TI"&"abc\r".chomp # => "abc" ;TI"&"abc\n".chomp # => "abc" ;TI"&"abc\r\n".chomp # => "abc" ;TI"("abc\n\r".chomp # => "abc\n" ;TI"/"тест\r\n".chomp # => "тест" ;TI"9"こんにちは\r\n".chomp # => "こんにちは" ;T:@format0o; ; [I"7When +line_sep+ is <tt>''</tt> (an empty string), ;TI"Oremoves multiple trailing occurrences of <tt>"\n"</tt> or <tt>"\r\n"</tt> ;TI"0(but not <tt>"\r"</tt> or <tt>"\n\r"</tt>):;T@o;; [ I"0"abc\n\n\n".chomp('') # => "abc" ;TI"0"abc\r\n\r\n\r\n".chomp('') # => "abc" ;TI"0"abc\n\n\r\n\r\n\n\n".chomp('') # => "abc" ;TI"<"abc\n\r\n\r\n\r".chomp('') # => "abc\n\r\n\r\n\r" ;TI"6"abc\r\r\r".chomp('') # => "abc\r\r\r" ;T; 0o; ; [I"?When +line_sep+ is neither <tt>"\n"</tt> nor <tt>''</tt>, ;TI">removes a single trailing line separator if there is one:;T@o;; [I"#'abcd'.chomp('d') # => "abc" ;TI"#'abcdd'.chomp('d') # => "abcd";T; 0: @fileI" string.c;T:0@omit_headings_from_table_of_contents_below0I"(chomp(line_sep = $/) -> new_string ;T0[ I"(*args);T@1FI"String;TcRDoc::NormalClass00