Here you can find the source of quote(String str)
Parameter | Description |
---|---|
str | the input String (e.g. "myString") |
null if the input was null
Declaration
public static String quote(String str)
Method Source Code
//package com.java2s;
public class Main {
/**/* w ww. java2 s. c om*/
* Quote the given String with single quotes.
* @param str the input String (e.g. "myString")
* @return the quoted String (e.g. "'myString'"),
* or <code>null<code> if the input was <code>null</code>
*/
public static String quote(String str) {
return (str != null ? "'" + str + "'" : null);
}
}
Related