Modify

Opened 15 years ago

Closed 15 years ago

#858 closed Bug (No Bug)

Source code small change of StringSplit( )

Reported by: txj Owned by:
Milestone: Component: AutoIt
Version: 3.3.0.0 Severity: None
Keywords: StringSplit Cc:

Description

Hi !

I found a small shortage, in StringSplit( ), when last character of string is delimiter, last element of return array is null string.

demo code like this:

#include <array.au3>

$aReturn = StringSplit("c:\dir1\dir2\", "\")
_ArrayDisplay($aReturn,"$aReturn[ ] value")   ; display array
If $aReturn[$aReturn[0]] = "" Then MsgBox(0, "value", "last element of $aReturn[ ] is null string.")

run this code, you can see the last element of return array $aReturn is null string.

maybe change source code of StringSplit( ) to substract the last element is more better.

this shortage exists in AutoIT 3.2.12.1, 3.3.0.0.

Attachments (0)

Change History (1)

comment:1 Changed 15 years ago by Valik

  • Resolution set to No Bug
  • Status changed from new to closed

The behavior is correct. This will not be changed because it is not a bug.

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

Action
as closed The ticket will remain with no owner.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.