removes quotes(",') that wraps the string

@param string
@return
197537
public static String removeQuotes(String string, boolean trim) {
	if (string == null) return string;
	if (trim) string = string.trim();
	if (string.length() < 2) return string;

	if ((StringUtil.startsWith(string, '"') && StringUtil.endsWith(string, '"')) || (StringUtil.startsWith(string, '\'') && StringUtil.endsWith(string, '\''))) {
	    string = string.substring(1, string.length() - 1);
	    if (trim) string = string.trim();
	}
	return string;
    }
1303744
public function escape($string)
    {
        $string = mb_convert_encoding($string, 'UTF-8', 'UTF-8');
        $string = str_replace('{{', '', $string);
        $string = str_replace('}}', '', $string);

        return htmlentities($string, ENT_QUOTES, 'UTF-8');
    }
518260
protected function notInsideQuotes($string, $quote = true)
    {
        if ($quote) {
            $string = preg_quote($string);
        }

        return
            // double quotes - ignore "" and everything inside quotes for example " abc \"err "
            '(?:""|"(?:[^"]|\\")*?[^\\\]")(*SKIP)(*F)|' . $string .
            '|' .
            // single quotes - ignore '' and everything inside quotes for example ' abc \'err '
            '(?:\\\'\\\'|\'(?:[^\']|\\\')*?[^\\\]\')(*SKIP)(*F)|' . $string;
    }
1049178
static public String removeLeadingNewLines(String string) {
    	if (string == null) return string;
    	
    	int pos = 0;
    	int len = string.length();
    	boolean done = false;
    	while (!done) {
    		char c = string.charAt(pos);
    		if (c == '\n' || c == '\r') {
    			pos++;
    		} else {
    			done = true;
    		}

    		if (pos == len) {
    			done = true;
    		}
    	}
    	String result = string.substring(pos);
    	
    	logger.debug("removed " + pos + " new line characters");
    	return result;
    }
627348
static public String stripQuotes(String string0) {
        // if an empty string, return it
        if (string0.length() == 0) {
            return string0;
        }
        // if the first and last characters are quotes, just do 1 substring
        if (string0.length() > 1 && string0.charAt(0) == '"' && string0.charAt(string0.length() - 1) == '"') {
            return string0.substring(1, string0.length() - 1);
        } else if (string0.charAt(0) == '"') {
            string0 = string0.substring(1);
        } else if (string0.charAt(string0.length() - 1) == '"') {
            string0 = string0.substring(0, string0.length() - 1);
        }
        return string0;
    }
571012
public static String stripDoubleQuotes(String s)
    {
        String ret = s;
        if(hasDoubleQuotes(s))
            ret = s.substring(1, s.length()-1);
        return ret;
    }
424758
protected function _str_replace_outside_quotes()
        {
            $re_valid = '/
                # Validate string having embedded quoted substrings.
                ^                           # Anchor to start of string.
                (?:                         # Zero or more string chunks.
                  "[^"\\\\]*(?:\\\\.[^"\\\\]*)*"  # Either a double quoted chunk,
                | \'[^\'\\\\]*(?:\\\\.[^\'\\\\]*)*\'  # or a single quoted chunk,
                | [^\'"\\\\]+               # or an unquoted chunk (no escapes).
                )*                          # Zero or more string chunks.
                \z                          # Anchor to end of string.
                /sx';

            if (!preg_match($re_valid, $this->subject)) {
                throw new OneStringException("Subject string is not valid in the replace_outside_quotes context.");
            }

            $re_parse = '/
                # Match one chunk of a valid string having embedded quoted substrings.
                  (                         # Either $1: Quoted chunk.
                    "[^"\\\\]*(?:\\\\.[^"\\\\]*)*"  # Either a double quoted chunk,
                  | \'[^\'\\\\]*(?:\\\\.[^\'\\\\]*)*\'  # or a single quoted chunk.
                  )                         # End $1: Quoted chunk.
                | ([^\'"\\\\]+)             # or $2: an unquoted chunk (no escapes).
                /sx';

            return preg_replace_callback($re_parse, array($this, '_strReplaceOutsideQuotesCb'), $this->subject);
        }
149992
public static String escape(String string) {
        if (isEmpty(string)) return "";
        StringBuilder sb = new StringBuilder();
        char[] chars = string.toCharArray();
        for (int i = 0; i < chars.length; i++) {
            if (i == chars.length - 1 || chars[i] != '\r' || chars[i + 1] != '\n') {
                sb.append(escape(chars[i]));
            }
        }
        return sb.toString();
    }
1065176
public static function sanitizeString($string)
    {
        if (!$string) {
            return null;
        }

        // Remove linebreaks and HTML tags
        $string = str_ireplace(["\r\n", "\n", "\r"], " ", $string);
        $string = html_entity_decode($string, ENT_NOQUOTES, "UTF-8");
        $string = trim(strip_tags($string));

        if (!$string) {
            return null;
        }

        return (string)$string;
    }
1301868
public function quote ($string)
		{
			if (is_null($string)) {
				return 'NULL';

			} else if (is_int($string) || is_float($string)) {
				return $string;

			} else if ($string instanceof Raw || $string instanceof DatabaseQuery) {
				return (string) $string;

			} else {
				return $this->database->quote($string);
			}
		}
549472
public static String quote(String str) {
        int len = str.length();
        StringBuffer buf = new StringBuffer(len+2);
        buf.append("\"");
        char c;
        for (int i=0;i<len;i++) {
            c = str.charAt(i);
            if (c == '"' || c == '\\') {
                buf.append("\\");
            }
            buf.append(c);
        }
        buf.append("\"");
        return buf.toString();
    }
804668
public static function quote($string, $quote = array('"', '"'))
	{
		$quote = (array) $quote;

		if (empty($quote[1]))
		{
			$quote[1] = $quote[0];
		}

		return strpos($string, $quote[0])!== 0 ? ($quote[0] . $string . $quote[1]) : $string;
	}
1250413
public static function sanitize_string($string)
    {
        $string = self::remove_accents($string);
        $string = strtolower($string);
        $string = preg_replace('/[^a-zA-Z 0-9]+/', '', $string);
        $string = self::strip_space($string);

        return $string;
    }
273232
function _dequote($string)
	{
		if ((substr($string, 0, 1) == "'" || substr($string, 0, 1) == '"') &&
		substr($string, -1) == substr($string, 0, 1))
		return substr($string, 1, -1);
		else
		return $string;
	}
65015
public function cleanUrl($string)
    {
        // First replace ampersands with the word 'and'
        $string = str_replace('&', 'and', $string);

        // Remove slashes
        $string = str_replace('/', '-', $string);

        // Strip out any single quotes
        $string = str_replace("'", '', $string);

        // Remove unwelcome characters, and replace with dashes
        $string = preg_replace('/[^a-zA-Z0-9]+/', '-', $string);

        // Lower case
        $string = mb_strtolower($string);

        // Finally remove and trailing dashes
        $string = trim($string, '-');

        return $string;
    }
912745
public function quote($string)
    {
        if (!$this->getInstance()) {
            if (!$this->softQuoting) {
                throw new \Parable\ORM\Exception("Can't quote without a database instance.");
            }

            $string = str_replace("'", "", $string);
            return "'{$string}'";
        }
        return $this->getInstance()->quote($string);
    }
735341
private String removeQuotes(String toReplace) {
        String noQuotes = toReplace.replaceAll("\"", "");
        noQuotes = noQuotes.replaceAll("'", "");
        return noQuotes;
    }