Here you can find the source of quoteString(String s)
Parameter | Description |
---|---|
s | a parameter |
public static String quoteString(String s)
//package com.java2s; /******************************************************************************* * Copyright (c) 2015 CA. All rights reserved. * * This source file is licensed under the terms of the Eclipse Public License 1.0 * For the full text of the EPL please see https://www.eclipse.org/legal/epl-v10.html *******************************************************************************/ public class Main { /**/*from ww w . ja va 2 s . c om*/ * quoteString * @param s * @return */ public static String quoteString(String s) { String quoteStr = s.trim(); if (!quoteStr.startsWith("'") && !quoteStr.endsWith("'")) { quoteStr = "'" + quoteStr + "'"; return quoteStr; } return s; } }