next up previous contents index
Next: stdin Up: TextReader Previous: read!   Contents   Index


readUntil!,readWhile!,skipUntil!,skipWhile!


Usage

readUntil!(str, s, c)
readWhile!(str, s, read?)
skipUntil!(s, c)
skipWhile!(s, read?)


Signatures

readUntil!: (StringBuffer, %, Character) $\to$ Character
readWhile!: (StringBuffer, %, Character $\to$ Boolean) $\to$ Character
skipUntil!: (%, Character) $\to$ Character
skipWhile!: (%, Character $\to$ Boolean) $\to$ Character


Parameter Type Description
str StringBuffer a buffer
s % a stream
c Character a character
read? Character $\to$ Boolean a predicate


Description

readUntil!(str, s, c) reads characters from s and stores them in str, until the character c is read. Returns c if it is read, eof otherwise. readWhile!(str, s, read?) reads characters from s and stores them in str as long as read? is true on the characters read. Returns either the first character read for which read? is false or eof. skipUntil! and skipWhile! work like readUntil! and readWhile! except that the characters read are not stored anywhere.


next up previous contents index
Next: stdin Up: TextReader Previous: read!   Contents   Index
Manuel Bronstein 2004-06-28