unquote

Summary

Removes quotation marks (double and single).

Usage

public string unquote()

Returns

The string without quotation marks.

Description

Strips both double and single quotes from the beginning and end of the string, but only for quote pairs. (Strings beginning with a single quote must end with a single quote, and strings beginning with double quotes must end with double quotes.)

Examples

Unquoting Double Quotes
1
2
3
import System;
 
string unquoted = '"abc"'.unquote(); // abc
Unquoting Single Quotes
1
2
3
import System;
 
string unquoted = "'abc'".unquote(); // abc
No Unquoting (No matching quote pair)
1
2
3
import System;
 
string unquoted = "'abc\"".unquote(); // 'abc"

Share

HTML | BBCode | Direct Link