Substring
Substring will cut an ascii, wide charactor or biniary string, from the start location for a given length.
TVariable Substring( __int64 start, __int64 length = 0 );
Parameters
start | this will cut from the start location, widechars are 16bit blocks, while ascii and binary strings are 8bit blocks. If start is negative, the returned string will start at the start 'th character from the end of string. |
length | this will cut this length from start, widechars are 16bit blocks, while ascii and binary strings are 8bit blocks. It this value is zero then the remaining length of the string will be returned. If length is given and is negative, then that many characters will be omitted from the end of string (after the start position has been calculated when a start is negative). |
Return Values
This method will return the a temporary const value created on the stack.
Remarks
- This method will return a TVariable of the same type as the original TVariable.
Example Use
- C++
#include "TScript.h" int wmain(int argc, wchar_t* argv[]) { TVariable var(u"123"); MessageBox((wchar_t*)var.Substring(1,1).WString()); //will show a message "2" return NO_ERROR; }
Since
TScript Version 1.1.0
Also See
Copy, Position, StringReplaceListen All
Comments (0)