AnsiPos

Locates the position of a substring within a string.

 

function AnsiPos(const Substr, S: string): Integer;

Description

Call AnsiPos to obtain the byte offset of the Substr parameter, as it appears in the string S. For example, if Substr is the string 'AB', and S is the string 'ABCDE', AnsiPos returns 1. If Substr does not appear in S, AnsiPos returns 0.

 

Example

if AnsiPos('.', ResultStr) <> 0 then

MessageBox('ResultStr含有.');

posted on 2012-08-15 16:40  孤独的流浪汉  阅读(188)  评论(0编辑  收藏  举报

导航