Click or drag to resize

MBSubstr2 Function

X#
Extract a substring from a string, using strong typing and only two arguments — both the substring and the string can contain double-byte characters.

Namespace:  XSharp.VO
Assembly:  XSharp.VO (in XSharp.VO.dll) Version: 2.21
Syntax
 FUNCTION MBSubstr2(
	cMBTarget AS STRING,
	wStart AS DWORD
) AS STRING
Request Example View Source

Parameters

cMBTarget
Type: String
The string from which to extract a substring.
wStart
Type: DWord
The starting position relative to the leftmost character in cMBTarget.

Return Value

Type: String
The substring.
If the substring is not present, or if you specify wStart as zero, MBSubstr2() returns a NULL_STRING.
Remarks
MBSubstr2() is a typed version of MBSubstr().
The third argument of MBSubstr() which counts the number of characters is not allowed. Instead, this function starts at the specified location and extracts to the end of the string.
Also, because wStart cannot be negative, MBSubstr2() cannot extract a substring relative to the rightmost character of cMBTarget as can MBSubstr().
Remarks
Tip Tip
This function is the same as Substr2() since .Net has unicode strings
Examples