Java String Quote quote(String value)

Here you can find the source of quote(String value)

Description

quote

License

Open Source License

Declaration

public static String quote(String value) 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * Copyright (c) 2014 Boeing./*from w w  w . j a v  a2s  .  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
 *
 * Contributors:
 *     Boeing - initial API and implementation
 *******************************************************************************/

public class Main {
    public static String quote(String value) {
        String toReturn = value;
        if (value != null) {
            StringBuilder builder = new StringBuilder();
            builder.append("\"");
            builder.append(value);
            builder.append("\"");
            toReturn = builder.toString();
        }
        return toReturn;
    }
}

Related

  1. quote(String txt)
  2. quote(String val)
  3. quote(String val)
  4. quote(String val, char quote)
  5. quote(String value)
  6. quote(String value)
  7. quote(String value)
  8. quote(StringBuilder buf, String str)
  9. quote(StringBuilder sb, String str)