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
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
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
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