Scanner

Build Status Build status

This crate provides a Java-like Scanner which can parse primitive types and strings using UTF-8.

Example

```rust extern crate scanner_rust;

use scanner_rust::Scanner;

let mut sc = Scanner::scan_slice(" 123 456.7 \t\r\n\n c中文字\n\tHello world!");

asserteq!(Some(123), sc.nextu8().unwrap()); asserteq!(Some(456.7), sc.nextf64().unwrap()); asserteq!(Some(' '), sc.nextchar().unwrap()); asserteq!(Some(' '), sc.nextchar().unwrap()); asserteq!(true, sc.skipwhitespaces().unwrap()); asserteq!(Some('c'), sc.nextchar().unwrap()); asserteq!(Some("中文字".into()), sc.nextline().unwrap()); asserteq!(Some("\tHello world!".into()), sc.nextline().unwrap()); asserteq!(None, sc.nextline().unwrap()); ```

See examples.

Crates.io

https://crates.io/crates/scanner-rust

Documentation

https://docs.rs/scanner-rust

License

MIT