Hey, how do i find out if the last char of a string is, let's say 'a'?

Thanks.
Posted on 2003-10-05 04:20:25 by Ghirai
This is one way...

invoke StrLen,OFFSET String ; <- From MASM32Lib
add eax,OFFSET String
dec eax
mov al,
.IF al == "a"

.ENDIF
Posted on 2003-10-05 04:38:53 by donkey
Ok, thanks.
Posted on 2003-10-05 04:42:46 by Ghirai
if not using Win32 API, try this:



mov edi,lpStr
xor al,al
mov ecx,-1
repnz scasb
.if byte ptr [edi-2]=='a'
...
.endif
Posted on 2003-10-05 08:07:50 by optimus