描述
从字符串中提取字符(但不包括)字符串或字符组.此函数区分大小写.
FreeBASIC 语法
FUNCTION AfxStrExtract ( _ BYVAL nStart AS LONG, _ BYREF wszMainStr AS WSTRING, _ BYREF wszMatchStr AS WSTRING _ ) AS CWSTR |
FUNCTION AfxStrExtractAny ( _ BYVAL nStart AS LONG, _ BYREF wszMainStr AS WSTRING, _ BYREF wszMatchStr AS WSTRING _ ) AS CWSTR |
参数
nStart
[in]的起始位置.
wszMainStr
[in]主串.
wszMatchStr
[in]要搜索的字符串.如果AfxExtractAny称,wszMatchStr指定要搜索的字符分别.一个匹配的任何一个将导致提取操作进行到该字符.
用法示例
The following line returns "aba" (match on "cad")
DIM cws AS CWSTR = AfxStrExtract(1, "abacadabra","cad")
The following line returns "aba" (match on "c")
DIM cws AS CWSTR = AfxStrExtractAny(1, "abacadabra","cd")
引用文件
AfxStr.inc