#150142 - 2005-10-17 11:19 PM
[edit] SPLIT [/edit] enhancement
|
Howard Bullock
KiX Supporter
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
Split($string,"") or even SPLIT($string) should return an array of single characters. This was suggested previously and rejected. Can it be reconsidered?
Edited by Howard Bullock (2005-10-18 05:33 AM)
|
Top
|
|
|
|
#150145 - 2005-10-18 12:11 AM
Re: SPILT enhancement
|
kholm
Korg Regular
Registered: 2000-06-19
Posts: 714
Loc: Randers, Denmark
|
Howard
This one is impossible: SPLIT($string) Because default split character is allready space, so it cannot be used because of backwords compatibility
This one Split($string,"") Might be the solution, if Ruud wil make the change
It could be a great tool to find the first different char when comparing two strings
I see that Shawn wishes for this functionality too, I suspect You both for for this wish to make an easy translates from other programming languages
I'll allso vote for this even if an UDF to split a string into an array of chars only needs about 5 lines.
-Erik
|
Top
|
|
|
|
#150146 - 2005-10-18 12:15 AM
Re: SPILT enhancement
|
Radimus
Moderator
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
Something like?
$array = Chars(string)
|
Top
|
|
|
|
#150149 - 2005-10-19 12:34 AM
Re: SPILT enhancement
|
kholm
Korg Regular
Registered: 2000-06-19
Posts: 714
Loc: Randers, Denmark
|
Shawn
I have to wonder like You:
Quote:
Optional. String character(s) used to identify substring limits. If omitted, the space character (" ") is assumed to be the delimiter. If delimiter is a zero-length string, a single-element array containing the entire expression string is returned.
Wonder what that rational was behind that last design choice (to return the entire string instead of an array of chars) ... prolly a useful purpose in that too.
Why send a string to a function and return the same string??
I belive this is easy to implement for Ruud, that's why i'm woting for it.
It could be done in two ways: - Split($string,"") ; Second parameter is an empty string 0-length - Split($string,0) ; Second parameter mening no split char
In my oppinion we should not invent a new function to do this!
-Erik
ps. KiXtart functions behaves exactly like vb-functions, just a litle better (smaller code), why not stay ahead
I hope the suggestion is not spilt
|
Top
|
|
|
|
Moderator: Lonkero, ShaneEP, Jochen, Radimus, Glenn Barnas, Allen, Ruud van Velsen, Mart
|
0 registered
and 557 anonymous users online.
|
|
|