diveboy Posted January 20, 2007 Posted January 20, 2007 CODE $filename = "Dexter-s02-e01er-s01-e02yr.avi" $dot = StringInStr($filename,".",-1) $fileext = Stringright($filename,($dot-1)) I'm trying to get the ".avi" from the $filename. the StringInStr function is returning 27 which is correct from the left, but the -1 should have it going from the right, which should give 5 correct ? thanks Michael.
Moderators SmOke_N Posted January 20, 2007 Moderators Posted January 20, 2007 CODE $filename = "Dexter-s02-e01er-s01-e02yr.avi" $dot = StringInStr($filename,".",-1) $fileext = Stringright($filename,($dot-1)) I'm trying to get the ".avi" from the $filename. the StringInStr function is returning 27 which is correct from the left, but the -1 should have it going from the right, which should give 5 correct ? thanks Michael.You have -1 in the case sensitivity parameter.$dot = StringInStr($filename, ".", 0, -1) Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
Developers Jos Posted January 20, 2007 Developers Posted January 20, 2007 (edited) CODE$filename = "Dexter-s02-e01er-s01-e02yr.avi"$dot = StringInStr($filename,".",-1)$fileext = Stringright($filename,($dot-1))I'm trying to get the ".avi" from the $filename. the StringInStr function is returning 27 which is correct from the left, but the -1 should have it going from the right, which should give 5 correct ?thanksMichael.Nope... -1 (when used in the correct parameter position) means "find the first occurrence from the right" but still will returns the character position counting from the left. Edited January 20, 2007 by JdeB SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
diveboy Posted January 20, 2007 Author Posted January 20, 2007 crap. why didn't I see that. Thanks a million.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now