Java.Util.Scanner Class
A parser that parses a text string of primitive types and strings with the help of regular expressions.

See Also: Scanner Members

Syntax

[Android.Runtime.Register("java/util/Scanner", DoNotGenerateAcw=true)]
public sealed class Scanner : Java.Lang.Object, Java.IO.ICloseable, IIterator, IDisposable

Remarks

A parser that parses a text string of primitive types and strings with the help of regular expressions. This class is not as useful as it might seem. It's very inefficient for communicating between machines; you should use JSON, protobufs, or even XML for that. Very simple uses might get away with Java.Lang.String.Split(string). For input from humans, the use of locale-specific regular expressions make it not only expensive but also somewhat unpredictable.

This class supports localized numbers and various radixes. The input is broken into tokens by the delimiter pattern, which is \\p{javaWhitespace} by default.

Example:

java Example

 Scanner s = new Scanner("1A true");
 assertEquals(26, s.nextInt(16));
 assertEquals(true, s.nextBoolean());
 

The Scanner class is not thread-safe.

[Android Documentation]

Requirements

Namespace: Java.Util
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 1