Here you can find the source of quoteSpecial(String orig)
Parameter | Description |
---|---|
orig | starting starting |
public static String quoteSpecial(String orig)
//package com.java2s; /******************************************************************************* * Copyright (c) 2010 Gregory Smith (gsmithfarmer@gmail.com). * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * //from w w w .jav a 2s . co m * Contributors: * Gregory Smith (gsmithfarmer@gmail.com) - initial API and implementation ******************************************************************************/ public class Main { /** * Quote all "special" characters in a query. * * @param orig starting starting * @return orig with stuff like single quotes backslashes quoted. */ public static String quoteSpecial(String orig) { if (null == orig) { return null; } return orig.replace("\\", "\\\\").replace("'", "\\'"); } }