Skip to content
Reference > Methods

quote(text)

Definition

String quote(Object text)

Description

Returns a string that surrounds the supplied string in quotes(") and escape any existing quotes with a backslash(). Returns null if supplied string is null.

Parameter Definition

Name Type Description
text Object String to escape

Examples

String r1 = quote("simple"); // r1 == "simple"
String r2 = quote("this \"is\" less simple"); // r2 == "this \"is\" less simple"