Android.Net.UrlQuerySanitizer Class
Sanitizes the Query portion of a URL.

See Also: UrlQuerySanitizer Members

Syntax

[Android.Runtime.Register("android/net/UrlQuerySanitizer", DoNotGenerateAcw=true)]
public class UrlQuerySanitizer : Java.Lang.Object

Remarks

Sanitizes the Query portion of a URL. Simple example: UrlQuerySanitizer sanitizer = new UrlQuerySanitizer(); sanitizer.setAllowUnregisteredParamaters(true); sanitizer.parseUrl("http://example.com/?name=Joe+User"); String name = sanitizer.getValue("name")); // name now contains "Joe_User" Register ValueSanitizers to customize the way individual parameters are sanitized: UrlQuerySanitizer sanitizer = new UrlQuerySanitizer(); sanitizer.registerParamater("name", UrlQuerySanitizer.createSpaceLegal()); sanitizer.parseUrl("http://example.com/?name=Joe+User"); String name = sanitizer.getValue("name")); // name now contains "Joe User". (The string is first decoded, which // converts the '+' to a ' '. Then the string is sanitized, which // converts the ' ' to an '_'. (The ' ' is converted because the default unregistered parameter sanitizer does not allow any special characters, and ' ' is a special character.) There are several ways to create ValueSanitizers. In order of increasing sophistication:

  1. Call one of the UrlQuerySanitizer.createXXX() methods.
  2. Construct your own instance of UrlQuerySanitizer.IllegalCharacterValueSanitizer.
  3. Subclass UrlQuerySanitizer.ValueSanitizer to define your own value sanitizer.

[Android Documentation]

Requirements

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