Get-Substring-by-Length
Command Description
Extract the characters from the specified position, starting from 1
Command Prototype
sRet = SubStr(sData,iStart,iSize)
Parameter Description
Parameter | Required | Type | Default | Description |
---|---|---|---|---|
sData | True | string | "" | Extracted raw string |
iStart | True | number | 1 | The position to start extracting the string |
iSize | True | number | 1 | The length of string to cut |
return
sRet,The variable used to save the output of the command.
Demo
TracePrint("----------------------Extract characters of specified length--------------------- ---")
//-------------------------------------------------------------------------------
//[Remarks] Extract the specified number of characters starting from the specified position from the string, and the position starts from 1.
//Input parameter 1:
// sData--The extracted source string.
//Input parameter 2:
// iStart--The starting position of the extracted string.
//Input parameter 3:
// iSize--The length of the trimmed string.
//out parameters:
// sRet--The variable to which the output of the function call is saved.
//
//Command prototype: sRet=SubStr(sData,iStart,iSize)
//-------------------------------------------------------------------------------
sRet = SubStr ("UiBot", 1.2)
TracePrint (sRet)