$qt

From Scriptwiki
Revision as of 11:00, 6 April 2008 by Albie (talk | contribs) (Added note about imbalanced ")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Adds or removes outer enclosing quotes around text. Particularly useful for specifying file names or paths with spaces.

$qt(<text>)
$noqt(<text>)

Example

$qt(My text.) returns "My text."
$qt("My text.") returns "My text."
$noqt(My Text.) returns My text.
$noqt("This is some "text"") returns This is some "text"

Note

Essentially these identifers check to see if the first and last character is a quote and adds or removes as needed. This means imbalanced strings would return as follows:

$qt("Text) returns "Text"
$qt(Text") returns "Text"
$noqt("Text) returns Text
$noqt(Text") returns Text

There is no checks for matching quotes.