Jump to content
Sign in to follow this  
Guest cariveau3680

Help with string manipulation

Recommended Posts

Guest cariveau3680

What am I doing wrong here?

I am trying to cut down strings like "c:\mydocs\myzips\testfile.zip" to "c:\mydocs\myzips" & "c:\mydocs\myzips\testfile" but it's not outputting anything

Global $StringTemp = ""

$StringIn = InputBox("StringTrimmer", "Please input a string to trim")
$DelIn = InputBox("StringTimmer", "Please input a delimiter")

$Ans = _StringTrimmer($StringIn, $DelIn)

MsgBox(0, "StringTrimmer", $StringIn & " trimmed with " & $DelIn & " is" & @CRLF & $Ans)

Func _StringTrimmer($String, $Del)
    $StringArray = StringSplit($String, $Del)
    For $Loop = 1 To $StringArray[$StringArray[0] - 1]
        $StringTemp = $StringTemp & $StringArray[$Loop]
        $StringTemp = $StringTemp & $Del
    Return $StringTemp

forgive me if this has been addressed

Share this post

Link to post
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
Sign in to follow this  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.