Skip to main content

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

ParameterRequiredTypeDefaultDescription
sDataTruestring""Extracted raw string
iStartTruenumber1The position to start extracting the string
iSizeTruenumber1The 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)