Android Guides | Samples

Java.Lang.String.ReplaceAll Method

Replaces all matches for regularExpression within this string with the given replacement.

Syntax

[Android.Runtime.Register("replaceAll", "(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;", "")]
public String ReplaceAll (String expr, String substitute)

See Also

Parameters

regularExpression
replacement

Exceptions

TypeReason
!:NoType:if the syntax of the supplied regular expression is not valid.
NullPointerExceptionif regularExpression == null

Remarks

Replaces all matches for regularExpression within this string with the given replacement. See Pattern for regular expression syntax.

If the same regular expression is to be used for multiple operations, it may be more efficient to reuse a compiled Pattern.

[Android Documentation]

Requirements

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