Re: [fpc-devel] Addtions for strutils

2006-01-22 Thread ik
On 1/21/06, Marco van de Voort [EMAIL PROTECTED] wrote: I wish to add 3 new string functions for strutils: 1. Check if a string is an integer (without + or - signs). Hmm, is this not a bit overspecialisation ? val(x,code); result:=(code=0) and (posexset(['+','-'],x)=0) would already

Re: [fpc-devel] Addtions for strutils

2006-01-22 Thread Jonas Maebe
On 22 Jan 2006, at 11:24, ik wrote: val(x,code); result:=(code=0) and (posexset(['+','-'],x)=0) would already do. (untested from memory) And why is that better ? Because it reuses existing code (although the above could even be made shorter by using TryStrToInt or so). Reusing existing

Re: [fpc-devel] Addtions for strutils

2006-01-21 Thread Marco van de Voort
I wish to add 3 new string functions for strutils: 1. Check if a string is an integer (without + or - signs). Hmm, is this not a bit overspecialisation ? val(x,code); result:=(code=0) and (posexset(['+','-'],x)=0) would already do. (untested from memory) 2. split a string into an array

[fpc-devel] Addtions for strutils

2006-01-18 Thread ik
Hi List, I wish to add 3 new string functions for strutils: 1. Check if a string is an integer (without + or - signs). 2. split a string into an array using a giving separator. 3. join an array into a string using a given separator char. I'm attaching the patch file that was taken from the