Jump to content

Recommended Posts

Posted

I know this is probably easy but I can't figure out the easiest way to do it. If i have a string that comes from a fileopendialog that looks like this \\172.28.206.7\Bservices\LST\AB\file.txt and I need to get only the last directory name so AB in this instance. how can i extract that out keeping in mind that that AB can be other directories named other things.

Posted

This works, too!

#Include <String.au3>
$string = "\\172.28.206.7\Bservices\LST\AB\file.txt"
$array = _StringExplode($string, "\")
If IsArray($array) Then MsgBox(0, "Test", $array[UBound($array) - 2])

BR,

UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...