#80943 - 2003-03-05 07:20 PM
Re: VB-type Functions: CLNG, MID, REPLACE
|
JensKalski
Starting to like KiXtart
Registered: 2000-12-13
Posts: 186
Loc: Germany
|
REPLACE would be very nice!
_________________________
Jens Kalski
|
Top
|
|
|
|
#80944 - 2003-03-05 10:28 PM
Re: VB-type Functions: CLNG, MID, REPLACE
|
Sealeopard
KiX Master
Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
|
How about this replace:
code:
function replace($str,$src,$rpl) $replace=join(split($str,$scr),$rpl) endfunction
[ 05. March 2003, 22:29: Message edited by: sealeopard ]
_________________________
There are two types of vessels, submarines and targets.
|
Top
|
|
|
|
#80948 - 2003-03-06 05:14 PM
Re: VB-type Functions: CLNG, MID, REPLACE
|
Lee Wilmott
Starting to like KiXtart
Registered: 2002-09-17
Posts: 106
Loc: Bristol, UK
|
A Replace() function would absolutely brilliant!
It would be nice to specify how many occurrences of the “text-to-replace” you would like replaced. (and maybe specify -1 to replace all occurrences).
One other thing...I know it is a "very" simple function but a RepeatStr() function would also be very helpful - this UDF appears in so many of my scripts.
Lee
|
Top
|
|
|
|
#80949 - 2003-03-06 07:12 PM
Re: VB-type Functions: CLNG, MID, REPLACE
|
JensKalski
Starting to like KiXtart
Registered: 2000-12-13
Posts: 186
Loc: Germany
|
Hi sealeopard, it works fine. I doesn't know that join() works with more than one character as delimiter. In the helpfile stands "string character"?!?
Thanks for this workaround.
It would be nice if those little tricks and workaround find a way into the kixhelp.chm.
_________________________
Jens Kalski
|
Top
|
|
|
|
Moderator: Lonkero, ShaneEP, Jochen, Radimus, Glenn Barnas, Allen, Ruud van Velsen, Mart
|
0 registered
and 515 anonymous users online.
|
|
|