Afficher un message
Vieux 16/09/2007, 16h29   #1
ZyLo
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut IO#gets(sep_string) usage

Hello all. I'm trying to use the gets function, only I want to read
in a file and make separators any sort of punctuation(",", ":", "\n",
etc.).

My problem is trying to understand how the sep_string=$/ option is
supposed to work:

ios.gets(sep_string=$/)

How can I specify what sep_string is so that when I do something for a
while loop on gets, I can get each word instead of a line of text, or
lines of text with various punctuation I don't want?

A second note, I'm not sure what $/ is supposed to mean. Is that the
separator for newline(which i thought was \n)?

Thanks in advance.

  Réponse avec citation
 
Page generated in 0,05172 seconds with 9 queries