Guest cariveau3680 Posted March 27, 2005 Posted March 27, 2005 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
Developers Jos Posted March 27, 2005 Developers Posted March 27, 2005 your For statement is wrong... should be:For $Loop = 1 To $StringArray[0] - 1 SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
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