Morgans43
asked on
TryIntToStr and partial strings...
I need to find out if a string contains a number... and return the numeric part in one field and the string parts in (two) other fields.
The string may be along the lines of...
AAAA123456BBBBB or 123456AAAAAAA or AAAAAA123456.
What is the easiest way to pull out the number?
The string may be along the lines of...
AAAA123456BBBBB or 123456AAAAAAA or AAAAAA123456.
What is the easiest way to pull out the number?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
That helps... thanks
begin
Part2Str := '';
result := '';
for i := 1 to length(InputStr) do
if inputstr[i] in ['0'..'9'] then
result := result + inputstr[i]
inputStr := copy(InputStr,1,length(res
Part2Str := copy(InputStr,Length(resul
end;
//usage sample
edit3.Text := WhatEverName(Edit1.text,ed
whereas
edit3 holds the numberstring
edit1 holds then after call the charstr-part before, if there any
edit2 holds then after call the charstr-part after, if there any
just from scratch
not tested
meikl ;-)