再给你来一个,不支持中文:function FastPosNoCase( const aSourceString, aFindString : String; const aSourceLen, aFindLen, StartPos : integer ) : integer;Pascal// Remove by SunLujiang{var SourceLen : integer;begin SourceLen := aSourceLen; SourceLen := SourceLen - aFindLen; if (StartPos-1) > SourceLen then begin Result := 0; Exit; end; SourceLen := SourceLen - StartPos; SourceLen := SourceLen +2;}// Remove end asm push ESI push EDI push EBX // Add by SunLujiang Mov ECX, aSourceLen Mov EAX, aFindLen Sub ECX, EAX Jo @Result0 Mov EAX, StartPos Dec EAX Sub ECX, EAX Jo @Result0 Inc ECX Inc ECX // Add end mov EDI, aSourceString add EDI, StartPos Dec EDI mov ESI, aFindString // Remove by SunLujiang// mov ECX, SourceLen // Remove end Mov Al, [ESI] // Add by SunLujiang Cmp Al,97 Jb @NotLowerCase1 Cmp Al,122 Jnb @NotLowerCase1 // Add end // Make Al lowercase. and Al, $df // Add by SunLujiang @NotLowerCase1: // Add end @ScaSB: Mov Ah, [EDI] // Add by SunLujiang Cmp Ah,97 Jb @NotLowerCase2 Cmp Ah,122 Jnb @NotLowerCase2 // Add end // Make Ah lowercase. and Ah, $df // Add by SunLujiang @NotLowerCase2: // Add end cmp Ah,Al jne @NextChar @CompareStrings: mov EBX, aFindLen dec EBX //add by ShengQuanhu Jz @EndOfMatch //add end @CompareNext: mov Al, [ESI+EBX] mov Ah, [EDI+EBX] // Add by SunLujiang Cmp Al,97 Jb @NotLowerCase3 Cmp Al,122 Jnb @NotLowerCase3 // Add end // Make Al and Ah lowercase. and Al, $df // Add by SunLujiang @NotLowerCase3: Cmp Ah,97 Jb @NotLowerCase4 Cmp Ah,122 Jnb @NotLowerCase4 // Add end and Ah, $df // Add by SunLujiang @NotLowerCase4: // Add end cmp Al, Ah Jz @Matches Mov Al, [ESI] // Make Al lowercase. and Al, $df Jmp @NextChar @Matches: Dec EBX Jnz @CompareNext //add by Shengquanhu @EndOfMatch: //add end mov EAX, EDI sub EAX, aSourceString inc EAX mov Result, EAX jmp @TheEnd @NextChar: Inc EDI dec ECX jnz @ScaSB //add by SunLujiang @Result0: //add end mov Result,0 @TheEnd: pop EBX pop EDI pop ESI// Remove by SunLujiang// end;// Remove endend;