Get-Length
Command Description
Get the length of a string or an array
Command Prototype
iRet = Len(varData)
Parameter Description
| Parameter | Required | Type | Default | Description | 
|---|---|---|---|---|
| varData | True | expression | $PrevResult | The string or array to operate on | 
return
iRet,The variable used to save the output of the command.
Demo
TracePrint("---------------------------------Length of string Hello World------- -----------------------------") 
//------------------------------------------------------------------------------- 
//[Remarks] Get the length of the string. 
//Input parameter 1: 
//      varData----->String type 
//out parameters: 
//       returns the length of the string 
a = "Hello World" 
bRet   =   Len 
TracePrint("The length of the string variable a is: ") 
TracePrint(bRet)