SiMX Help‎ > ‎The Target Platform‎ > ‎Objects‎ > ‎TARGET Object‎ > ‎target.strlib‎ > ‎


Platform Objects


          Delete a section of a string based on a starting position and a length.
          This will take the input field "Lot Number" and delete 5 characters after the third position and set that new string (str2) as the "lot" output field.  


     target.strlib.Delete( input, pos, length )

input (input) - the string that you want to work with
pos (input) - where you want to start the deletion
length (input) - how much of the string you want to delete

Return value

This function returns a string.

'---------- Start ----------
Function Start
Dim str, str2

str = "Lot Number"
str2 = target.strlib.Delete( str, 4, 7 )
trg.Message( str2 )

End Function

In this case we are taking the input string and starting from the fourth position we are deleting seven spaces. This takes Lot Number and leaves us with just Lot.

See also

Platform Objects and Methods