Articles

[Collapse]TestComplete/viewarticle/88628/
 [Expand]General Information/viewarticle/88628/
 [Expand]Using Help System/viewarticle/81465/
 [Expand]Getting Started Tutorial/viewarticle/82003/
 [Expand]Using TestComplete/viewarticle/84431/
 [Expand]Testing Types/viewarticle/85355/
 [Expand]Applications Testing/viewarticle/83383/
 [Expand]Working With Application Objects and Controls/viewarticle/81481/
 [Expand]Samples and Tutorials/viewarticle/81997/
 [Collapse]References/viewarticle/82523/
  [Expand]Test Objects/viewarticle/82423/
  [Collapse]Scripting Objects/viewarticle/88052/
   [Collapse]A
    [Expand]ADO/viewarticle/80914/
    [Expand]ADODriver/viewarticle/85992/
    [Expand]aqBinaryFile/viewarticle/81165/
    [Expand]aqConvert/viewarticle/80894/
    [Expand]aqDateTime/viewarticle/80885/
    [Expand]aqDriveInfo/viewarticle/87059/
    [Expand]aqEnvironment/viewarticle/80889/
    [Expand]aqFile/viewarticle/80893/
    [Expand]aqFileCertificateInfo/viewarticle/82971/
    [Expand]aqFileInfo/viewarticle/80967/
    [Expand]aqFileSystem/viewarticle/80888/
    [Expand]aqFileVersionInfo/viewarticle/87043/
    [Expand]aqFolderInfo/viewarticle/81106/
    [Expand]aqObject/viewarticle/80903/
    [Expand]aqObjEvent/viewarticle/86211/
    [Expand]aqObjField/viewarticle/84066/
    [Expand]aqObjIterator/viewarticle/83010/
    [Expand]aqObjMethod/viewarticle/82795/
    [Expand]aqObjProperty/viewarticle/81316/
    [Expand]aqPerformance Object/viewarticle/81422/
    [Expand]aqString/viewarticle/80904/
    [Expand]aqTextFile/viewarticle/88687/
    [Expand]AQtime/viewarticle/80793/
    [Expand]AQtimeIntegration/viewarticle/80611/
    [Expand]aqUtils/viewarticle/80915/
   [Expand]B
   [Expand]C
   [Expand]E
   [Expand]D
   [Expand]F
   [Expand]H
   [Expand]I
   [Expand]J
   [Expand]O
   [Expand]P
   [Expand]R
   [Expand]S
   [Expand]T
   [Expand]U
   [Expand]W
   [Expand]V
   [Expand]Obsolete Objects
  [Expand]Project and Project Item Objects/viewarticle/84209/
  [Expand]TestComplete Events/viewarticle/83126/
  [Expand]Language Reference/viewarticle/87902/
  [Expand]User Form Components/viewarticle/83917/
   Regular Expressions Syntax/viewarticle/81060/
 [Expand]Other Tools That Help You Test Better/viewarticle/82893/
 [Expand]Licensing Guide/viewarticle/88365/
Updated: 7/26/2016 Applies To: TestComplete 12 Rating: No votes Click to rate: PoorNot badAverageGoodExcellent
Programming Reference

aqString Object

Description

The aqString object lets you perform various operations on string values.

Members

Example

The code below divides the specified string into characters and posts them to the test log.

JavaScript, JScript

function StringByLetter()
{
  
  // Specifies the string
  var aString = "Per aspera ad astra";
  Log.Message("The string is : " + aString);
  Log.Message("And now, this text letter by letter using the GetChar method:");
  
  // Posts the specified string letter by letter to the test log
  for (var i = 0; i < aqString.GetLength(aString); i++)
    Log.Message(aqString.GetChar(aString, i));
  
}

Python

def StringByLetter():
  # Specifies the string 
  aString = "Per aspera ad astra"
  Log.Message("The string is : " + aString)
  Log.Message("And now, this text letter by letter using the GetChar method:")
  # Posts the specified string letter by letter to the test log
  for i in range(0, aqString.GetLength(aString)):
    Log.Message(aqString.GetChar(aString, i))

VBScript

Sub StringByLetter
  Dim aString, i
  
  ' Specifies the string
  aString = "Per aspera ad astra"
  Log.Message("The string is : " & aString)
  Log.Message("And now, this text letter by letter using the GetChar method:")
  
  ' Posts the specified string letter by letter to the test log
  For i = 0 To aqString.GetLength(aString)-1
    Log.Message(aqString.GetChar(aString, i))
  Next
  
End Sub

DelphiScript

function StringByLetter;
var aString, i;
begin

  // Specifies the string
  aString := 'Per aspera ad astra';
  Log.Message('The string is : ' + aString);
  Log.Message('And now, this text letter by letter using the GetChar method:');
  
  // Posts the specified string letter by letter to the test log
  for i := 0 to aqString.GetLength(aString)-1 do
    Log.Message(aqString.GetChar(aString, i));
  
end;

C++Script, C#Script

function StringByLetter()
{
  
  // Specifies the string
  var aString = "Per aspera ad astra";
  Log["Message"]("The string is : " + aString);
  Log["Message"]("And now, this text letter by letter using the GetChar method:");
  
  // Posts the specified string letter by letter to the test log
  for (var i = 0; i < aqString["GetLength"](aString); i++)
    Log["Message"]( aqString["GetChar"](aString, i) );
  
}

See also
Working With Strings | TestComplete Helper Objects | aqConvert Object | aqDateTime Object | aqEnvironment Object | aqFile Object | aqFileSystem Object | aqObject Object | aqUtils Object


© 2016 SmartBear Software. All rights reserved.
Email Send feedback on this document