Android Guides | Samples

Java.Lang.String.Replace Method

Returns a copy of this string after replacing occurrences of target replaced with replacement.

Syntax

[Android.Runtime.Register("replace", "(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String;", "")]
public String Replace (ICharSequence target, ICharSequence replacement)

Parameters

target
the sequence to replace.
replacement
the replacement sequence.

Exceptions

TypeReason
NullPointerExceptionif target or replacement is null.

Remarks

Returns a copy of this string after replacing occurrences of target replaced with replacement. The string is processed from the beginning to the end.

[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