Am Mittwoch, den 11.07.2007, 12:09 +0200 schrieb Michael Van Canneyt: > > On Tue, 10 Jul 2007, Marc Santhoff wrote:
[...] > > Wouldn't this function be a candidate for crawling into the 'strutils' > > unit? > > Probably, but I would change the interface: > > function Split(const str: string; const separator: string; var Res : array of > string) : Integer; > > So the function returns the number of elements in the array. > The function could also use some speedup. Deleting the parts > which are no longer needed causes a lot of memory fragmentation. I'd second your opinion about the interface, but regarding speedup and memory fragmentation makes me think. For speed I'd need some hints, what technique would be faster/fastest? And for memory fragmentation: avoiding Copy could be done by using pointers running over the input string, or is there an even better approach? Marc (not having found any information about 'this is faster than that' ;) _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal