Jump to content

How to remove this "\" ?


DeeRiee
 Share

Recommended Posts

Hello, i'm new here

I'm trying to remove this "\" from return of file select folder...

I'm try this

$folder=FileSelectFolder("Select","")
MsgBox(0,"Return",$folder)

If i select folder or subfolder

the return D:\My Folder\Sub Folder <--Nothing slash at the end >_<

If I select a Drive

the return being D:\ <--slash at the end :) How Can?

So, i need help how to remove that slash using StringSplit()

Because i'm newbie, i'm not understanding StringSplit() in help file...

Sorry 4 bad english, i'm indonesian :idiot:

Link to comment
Share on other sites

Hello, i'm new here

I'm trying to remove this "\" from return of file select folder...

I'm try this

$folder=FileSelectFolder("Select","")
MsgBox(0,"Return",$folder)

If i select folder or subfolder

the return D:\My Folder\Sub Folder <--Nothing slash at the end >_<

If I select a Drive

the return being D:\ <--slash at the end :) How Can?

So, i need help how to remove that slash using StringSplit()

Because i'm newbie, i'm not understanding StringSplit() in help file...

Sorry 4 bad english, i'm indonesian :idiot:

I don't think that is any problem if is D:\\

Anyway:

$FOLDER = FileSelectFolder("SELECT","")
If StringLen($FOLDER) = 3 Then 
    $FOLDER = StringLeft($FOLDER,2)
EndIf

When the words fail... music speaks.

Link to comment
Share on other sites

I don't think that is any problem if is D:\\

Anyway:

$FOLDER = FileSelectFolder("SELECT","")
If StringLen($FOLDER) = 3 Then 
    $FOLDER = StringLeft($FOLDER,2)
EndIf
Thanks... :idiot:

But... i want to learn more about String Function, where i can learn more and easier, because i'm not understanding the help file example and explanation about String, it's so hard >_<

Where i can learn more? :)

Link to comment
Share on other sites

Thanks... :P

But... i want to learn more about String Function, where i can learn more and easier, because i'm not understanding the help file example and explanation about String, it's so hard :idiot:

Where i can learn more? :)

I write for you an example with StringSplit():

$FOLDER = FileSelectFolder("SELECT","")
$SPLIT = StringSplit($FOLDER,"\")
If $SPLIT[2] = "" Then
    MsgBox(0,"","You select disk drive " & $SPLIT[1])
Else
    MsgBox(0,"","You select a folder from drive " & $SPLIT[1] & @CRLF & $FOLDER)
EndIf

More about String functions in help file. >_<

Edited by Andreik

When the words fail... music speaks.

Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...