Here you can find the source of quote(String str)
Parameter | Description |
---|---|
str | string to quote |
Parameter | Description |
---|---|
NullPointerException | if str is null |
public static String quote(String str)
//package com.java2s; public class Main { /**/*from ww w.j a va 2 s . c o m*/ * Returns the given string enclosed with quotation marks. * * @param str string to quote * @return quoted string * @throws NullPointerException if {@code str} is {@code null} */ public static String quote(String str) { return '"' + str.toString() + '"'; } }