D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
proc
/
self
/
root
/
opt
/
alt
/
ruby34
/
share
/
ri
/
system
/
String
/
Filename :
chop-i.ri
back
Copy
U:RDoc::AnyMethod[iI" chop:ETI"String#chop;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"BRemoves <tt>"\r\n"</tt> if those are the last two characters.;T@o:RDoc::Markup::Verbatim; [I"$"abc\r\n".chop # => "abc" ;TI"-"тест\r\n".chop # => "тест" ;TI"7"こんにちは\r\n".chop # => "こんにちは" ;T:@format0o; ; [I"7Otherwise removes the last character if it exists.;T@o;; [ I" 'abcd'.chop # => "abc" ;TI"''тест'.chop # => "тес" ;TI"0'こんにちは'.chop # => "こんにち" ;TI"''.chop # => "" ;T; 0o; ; [I"uIf you only need to remove the newline separator at the end of the string, String#chomp is a better alternative.;T: @fileI" string.c;T:0@omit_headings_from_table_of_contents_below0I"chop -> new_string ;T0[ I"();T@#FI"String;TcRDoc::NormalClass00