View source: R/streamParserFromString.R
| streamParserFromString | R Documentation |
Creates a list of functions which allow streamParser manipulation (when defined from a character string)
streamParserFromString(string)
string |
string to be recognised |
See streamParser
A list of four functions which allow stream manipulation:
streamParserNextChar |
Functions which takes a streamParser as argument ant returns a |
streamParserNextCharSeq |
Function which takes a streamParser as argument and returns a |
streamParserPosition |
Function which takes a streamParser as argument and returns position of next character to be read |
streamParserClose |
Function which closes the stream |
# reads one character
streamParserNextChar(streamParserFromString("\U00B6"))
# reads a string
stream <- streamParserFromString("Hello world")
cstream <- streamParserNextChar(stream)
while( cstream$status == "ok" ) {
print(streamParserPosition(cstream$stream))
print(cstream$char)
cstream <- streamParserNextCharSeq(cstream$stream)
streamParserClose(stream)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.