aqString.QuoteSymbol Property

Applies to TestComplete 15.0, last modified on November 17, 2021

Description

The QuoteSymbol property defines what symbol should be treated as a quotation mark. The default property value is double quotes (").

Declaration

aqString.QuoteSymbol

Read-Write Property String

Applies To

The property is applied to the following object:

Property Value

A string that contains the current quotation mark.

Example

The code below saves the current quote mark and sets a new one. Then the routine uses this mark to quote the specified string and posts this string to the test log. At the end of the test, the routine restores the quote mark's default value.

JavaScript, JScript

function QuoteSymbolDemo()
{
  // Saves the previous quote mark
  var prevQuote = aqString.QuoteSymbol;
 
  // Sets a new quote symbol
  aqString.QuoteSymbol = "/";
  
  // Quotes a string using a new quote symbol
  var qStr = aqString.Quote("The string to be quoted.");
  Log.Message(qStr);
  
  // Restores the previous quote mark
  aqString.QuoteSymbol = prevQuote;
}

/*
The routine produces the following output:

/The string to be quoted./
*/

Python

def QuoteSymbolDemo():
  # Saves the previous quote mark
  prevQuote = aqString.QuoteSymbol
  # Sets a new quote symbol
  aqString.QuoteSymbol = "/"
  # Quotes a string using a new quote symbol
  qStr = aqString.Quote("The string to be quoted.")
  Log.Message(qStr)
  # Restores the previous quote mark
  aqString.QuoteSymbol = prevQuote

# The routine produces the following output:
# /The string to be quoted./

VBScript

Sub QuoteSymbolDemo

  ' Saves the previous quote mark
  prevQuote = aqString.QuoteSymbol
 
  ' Sets a new quote symbol
  aqString.QuoteSymbol = "/"
  
  ' Quotes a string using a new quote symbol
  qStr = aqString.Quote("The string to be quoted.")
  Log.Message(qStr)
  
  ' Restores the previous quote mark
  aqString.QuoteSymbol = prevQuote
  
End Sub

' The routine produces the following output:
' /The string to be quoted./

DelphiScript

function QuoteSymbolDemo;
var prevQuote, qStr;
begin
  // Saves the previous quote mark
  prevQuote := aqString.QuoteSymbol;
 
  // Sets a new quote symbol
  aqString.QuoteSymbol := '/';
  
  // Quotes a string using a new quote symbol
  qStr := aqString.Quote('The string to be quoted.');
  Log.Message(qStr);
  
  // Restores the previous quote mark
  aqString.QuoteSymbol := prevQuote;
end;

{
The routine produces the following output:

/The string to be quoted./
}

C++Script, C#Script

function QuoteSymbolDemo()
{
  // Saves the previous quote mark
  var prevQuote = aqString["QuoteSymbol"];
 
  // Sets a new quote symbol
  aqString["QuoteSymbol"] = "/";
  
  // Quotes a string using a new quote symbol
  var qStr = aqString["Quote"]("The string to be quoted.");
  Log["Message"](qStr);
  
  // Restores the previous quote mark
  aqString["QuoteSymbol"] = prevQuote;
}

/*
The routine produces the following output:

/The string to be quoted./
*/

See Also

Working With Strings
Quote Method
Unquote Method

Highlight search results