Position

<strong>Position</strong> will find the occurance of a given fragment after the start offset.

int Position(
   const BYTE *search,
   int start = 0
);

int Position(
   const char16_t *search,
   int start = 0
);

int Position(
   const TVariable &search,
   int start = 0,
   int atom = 0
);

Parameters

searchthe pattern string to match. The TVariable version can match arrays of string and will return the position of the first match.
startthis is the byte offset of the start location. If start is negative, the returned string will start at the start 'th character from the end of string and search backward.
atomthis is the size of the blocks to match, for astring atom is 1 and for wstring it is 2.

Return Values

If the fragment is not matched, then -1 is returned, otherwise the byte offset of the next location of the fragment after the start position.

Remarks

Example Use
TVariable var("123");
TVariable pos = var.Position("2");//return - The value is 1
pos = var.Position(Bx00);//return - The value is 3

Since

TScript Version 1.1.0

Also See

Copy, SubString, StringReplace
Comments (0)Listen All
Characters left: 2500
 
Ekky Software Homepage Ekky Software Homepage ObjectDatabase++ TScript Ekky Software Homepage Ekky Software Homepage ObjectDatabase++ TScript