共用方式為


Pattern.Quote(String) Method

Definition

Returns a literal pattern String for the specified String.

[Android.Runtime.Register("quote", "(Ljava/lang/String;)Ljava/lang/String;", "")]
public static string Quote (string s);
[<Android.Runtime.Register("quote", "(Ljava/lang/String;)Ljava/lang/String;", "")>]
static member Quote : string -> string

Parameters

s
String

The string to be literalized

Returns

A literal string replacement

Attributes

Remarks

Returns a literal pattern String for the specified String.

This method produces a String that can be used to create a Pattern that would match the string s as if it were a literal pattern.

Metacharacters or escape sequences in the input sequence will be given no special meaning.

Added in 1.5.

Java documentation for java.util.regex.Pattern.quote(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