Here you can find the source of unquoteString(final String input)
Parameter | Description |
---|---|
input | string to edit |
Parameter | Description |
---|---|
IllegalArgumentException | if String is null |
public static String unquoteString(final String input)
//package com.java2s; //License from project: Creative Commons License public class Main { /**/* w w w. j ava 2 s . com*/ * Removes quotes from a string. * @param input string to edit * @return a string with quotes removed * @throws IllegalArgumentException if String is null */ public static String unquoteString(final String input) { if (input == null) throw new IllegalArgumentException("String cannot be null!"); return input.startsWith("\"") && input.endsWith("\"") || input.startsWith("'") && input.endsWith("'") ? input.substring(1, input.length() - 1) : input; } }