Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- dim as string n = "asdfkrisqwerty"
- dim as string q = "kris"
- for i as integer = 0 to len(n)-len(q)
- print *cptr(zstring ptr,strptr(n)+i)
- for j as integer = 0 to len(q)-1
- if n[i+j] <> q[j] then continue for,for
- print ,"found: "; chr(n[i+j]); " at position:"; i+j
- next j
- print
- print ,"found ";q;" at position:"; i
- print ,left$(n,i);"[";q;"]";mid$(n,i+len(q)+1)
- exit for
- next i
- sleep
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement