I have this one line of vbscript: if len(mAccount)=15 then if mAccount(0)="8" Then mAccount=left(mAccount,4) & right(mAccount,10) Code (markup): I am wondering how it's supposed to look. The purpose of course, is to read a number, evaluate length = 15 and that the first digit is "8", then I want to remove the fifth digit. I get an error around the second "if" Help from a pro is appreciated
Try replacing mAccount(0) with Mid(mAccount,1,1) The following should work: <% mAccount = "812305678912345" if (len(mAccount)=15 and Mid(mAccount,1,1)="8") Then mAccount=left(mAccount,4) & right(mAccount,10) end if response.write(mAccount) %>