Sign in to follow this  
Followers 0
Guest cariveau3680

Help with string manipulation

3 posts in this topic

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
    Next
    Return $StringTemp
EndFunc

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  
Followers 0