This commit is contained in:
Ingy döt Net 2013-04-10 21:29:02 -07:00
parent 764da6cbbb
commit db842d013d
19005 changed files with 197040 additions and 7 deletions

View file

@ -0,0 +1,26 @@
class Main
{
public static Void main ()
{
// example of reading by line
str := "first\nsecond\nthird\nword"
inputStream := str.in
inputStream.eachLine |Str line|
{
echo ("Line is: $line")
}
// example of reading by word
str = "first second third word"
inputStream = str.in
word := inputStream.readStrToken // reads up to but excluding next space
while (word != null)
{
echo ("Word: $word")
inputStream.readChar // skip over the preceding space!
word = inputStream.readStrToken
}
}
}