hot202 Posted February 25, 2010 Posted February 25, 2010 (edited) hi if i had something like this D:\something\JustShow this.exe how would i use StringSplit to just show what is after the last \ but it wont always be that long or it could be longer like. D:\something\something\something\JustShow this.exe i tryed to work it out but i couldnt get it to show the text after the last\ i could only do it if it was always the same amount of \ Edited February 25, 2010 by hot202
AndyG Posted February 25, 2010 Posted February 25, 2010 Hi, try this....#include <array.au3> ;only to show the array $path="D:\something\JustShow this.exe" $Array = stringSplit($path,"\",3) _ArrayDisplay($Array, "StringSplit()") msgbox(0,0,$Array[ubound($array)-1])if you need some more parts of a path-string, theĀ _pathsplit()would be an option
99ojo Posted February 25, 2010 Posted February 25, 2010 (edited) Hi, is this the goal: MsgBox (0,"", _mysplit ("D:\something\something\something\JustShow this.exe")) MsgBox (0,"", _mysplit ("D:\something\JustShow this.exe")) Func _mysplit ($string) $temp = StringSplit ($string, "\") Return $temp [Ubound ($temp) - 1] EndFunc ;-)) Stefan @Edit: To slow...... Edited February 25, 2010 by 99ojo
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