aqString.Quote Method

Applies to TestComplete 14.10, last modified on June 5, 2019

Description

The Quote method returns the quoted version of the given string (InputString). This function inserts quotation marks at the beginning and at the end of the string. The quotation mark is specified by the QuoteSymbol property, its default value is a double quote ( " ).

Declaration

aqString.Quote(InputString)

InputString [in]    Required    String    
Result String

Applies To

The method is applied to the following object:

Parameters

The method has the following parameter:

InputString

Specifies the string to be enclosed in quotes.

Result Value

The quoted version of the specified string.

Example

The code below encloses the specified string into double quotes and then posts the quoted string to the test log.

JavaScript, JScript

function QuoteDemo()
{
  var Str = "Hello!";
  // Encloses the specified string into double quotes
  var qStr = aqString.Quote(Str);
  // Posts the quoted string to the test log
  Log.Message(qStr);
}

/*
The routine produces the following output:

"Hello!"
*/

Python

def QuoteDemo():
  Str = "Hello!"
  # Encloses the specified string into double quotes
  qStr = aqString.Quote(Str)
  # Posts the quoted string to the test log
  Log.Message(qStr)

# The routine produces the following output:
# "Hello!"

VBScript

Sub QuoteDemo
  Str = "Hello!"
  ' Encloses the specified string into double quotes
  qStr = aqString.Quote(Str)
  ' Posts the quoted string to the test log
  Log.Message(qStr)
End Sub

' The routine produces the following output:
' "Hello!"

DelphiScript

function QuoteDemo;
var Str, qStr;
begin
  Str := 'Hello!';
  // Encloses the specified string into double quotes
  qStr := aqString.Quote(Str);
  // Posts the quoted string to the test log
  Log.Message(qStr);
end;

{
The routine produces the following output:

"Hello!"
}

C++Script, C#Script

function QuoteDemo()
{
  var Str = "Hello!";
  // Encloses the specified string into double quotes
  var qStr = aqString["Quote"](Str);
  // Posts the quoted string to the test log
  Log["Message"](qStr);
}

/*
The routine produces the following output:

"Hello!"
*/

See Also

Working With Strings
aqString.QuoteSymbol Property
aqString.Unquote Method

Highlight search results