Opened 17 years ago
Closed 16 years ago
#120 closed Feature Request (Rejected)
StringSplit limit parameter
Reported by: | Paulie | Owned by: | |
---|---|---|---|
Milestone: | Component: | AutoIt | |
Version: | Severity: | None | |
Keywords: | Stringsplit | Cc: |
Description
StringSplit("String","delimiters"[, flag [,limit]])
I was wondering how big of a hassle it would be to make StringSplit have an additional optional parameter that would limit the amount of splits. Similar to PHPs "explode"
Example
$String = "Test1|Test2|Test3|Test4" $Result = StringSplit($String, "|",1,2);<-2 would split to 2 elements (perform 1 split)
$Result[0] = 2 (redundant i suppose :\)
$Result[1] = "Test1"
$Result[2] = "Test2|Test3|Test4"
Reason
There have been multiple time that I've found myself splitting a long string only to use the first few elements, while it hasn't been a problem to use the current stringsplit for this, it seems like a feature that wouldn't hurt (especially considering it would be an optional param, so no script breaks)
I'm sure it's been considered, but i didn't see it suggested.
Thanks.
Attachments (0)
Change History (4)
comment:1 Changed 17 years ago by Valik
- Version 3.2.10.0 (Stable) deleted
comment:2 Changed 17 years ago by WeaponX
comment:3 Changed 17 years ago by Jpm
I would prefer to have a _StringExplode() Standard UDF than to add such extension to basic StringSplit()
comment:4 Changed 16 years ago by Valik
- Resolution set to Rejected
- Severity set to None
- Status changed from new to closed
I sort of agree with JP. If this is still important to anybody then somebody should take the appropriate steps to submit a _StringExplode() function.
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.
I posted an Explode function for anyone needing something like this:
http://www.autoitscript.com/forum/index.php?showtopic=64801&hl=explode