Server IP : 111.118.215.189 / Your IP : 216.73.216.153 Web Server : Apache System : Linux md-in-83.webhostbox.net 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64 User : a1673wkz ( 2475) PHP Version : 8.2.25 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON Directory (0755) : /proc/thread-self/root/opt/cpanel/ea-ruby24/root/usr/share/ri/system/IO/ |
[ Home ] | [ C0mmand ] | [ Upload File ] |
---|
U:RDoc::AnyMethod[iI" gets:ETI"IO#gets;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"IReads the next ``line'' from the I/O stream; lines are separated by ;TI"7<i>sep</i>. A separator of +nil+ reads the entire ;TI"Jcontents, and a zero-length separator reads the input a paragraph at ;TI"Ha time (two successive newlines in the input separate paragraphs). ;TI"FThe stream must be opened for reading or an <code>IOError</code> ;TI"Iwill be raised. The line read in will be returned and also assigned ;TI";to <code>$_</code>. Returns +nil+ if called at end of ;TI"Dfile. If the first argument is an integer, or optional second ;TI"Jargument is given, the returning string would not be longer than the ;TI"given value in bytes.;To:RDoc::Markup::BlankLine o:RDoc::Markup::Verbatim; [ I":File.new("testfile").gets #=> "This is line one\n" ;TI":$_ #=> "This is line one\n" ;TI" ;TI",File.new("testfile").gets(4)#=> "This" ;T:@format0o; ; [I"HIf IO contains multibyte characters byte then <code>gets(1)</code> ;TI" returns character entirely:;T@o;; [I"'# Russian characters take 2 bytes ;TI"3File.write("testfile", "\u{442 435 441 442}") ;TI"7File.open("testfile") {|f|f.gets(1)} #=> "\u0442" ;TI"7File.open("testfile") {|f|f.gets(2)} #=> "\u0442" ;TI"=File.open("testfile") {|f|f.gets(3)} #=> "\u0442\u0435" ;TI"<File.open("testfile") {|f|f.gets(4)} #=> "\u0442\u0435";T; 0: @fileI" io.c;T:0@omit_headings_from_table_of_contents_below0I"wios.gets(sep=$/) -> string or nil ios.gets(limit) -> string or nil ios.gets(sep, limit) -> string or nil ;T0[ I"(*args);T@*FI"IO;TcRDoc::NormalClass00