String.ReplaceFirst(String, String) Method

Definition

Replaces the first substring of this string that matches the given <a href=".

[Android.Runtime.Register("replaceFirst", "(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;", "")]
public string ReplaceFirst (string regex, string replacement);
[<Android.Runtime.Register("replaceFirst", "(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;", "")>]
member this.ReplaceFirst : string * string -> string

Parameters

regex
String

the regular expression to which this string is to be matched

replacement
String

the string to be substituted for the first match

Returns

String

The resulting String

Attributes

Exceptions

if regularExpression == null

Remarks

Java documentation for java.lang.String.replaceFirst(java.lang.String, java.lang.String).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

See also