Mark Brady
asked on
Remove the ' ' (blanks spaces) from combobox1 item ?
Hi team
This is a simple one but I can't get it right Grrrr.
I need to copy only the bytes or text with values from combobox1.itemindex.
The item has 20 bytes in it. The first so many contain a name and the rest is blank up to 20. If I use the whole line for a label name, and set autosize to true, the label width obviously sizes itself to fit 20 characters.
What is the code to only copy until that line shows a blank ' ' ????
Thanks in advance
Mark
p.s. The blank spaces need to be in the combobox for a reason.
This is a simple one but I can't get it right Grrrr.
I need to copy only the bytes or text with values from combobox1.itemindex.
The item has 20 bytes in it. The first so many contain a name and the rest is blank up to 20. If I use the whole line for a label name, and set autosize to true, the label width obviously sizes itself to fit 20 characters.
What is the code to only copy until that line shows a blank ' ' ????
Thanks in advance
Mark
p.s. The blank spaces need to be in the combobox for a reason.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Excellent !!! So simple and yet so far from my reach lol. That is a great little function that I have never heard of. Thank you so much.
Mark
Mark
begin
Str := StringReplace(Str, ' ', EmptyStr, [rfReplaceAll]);
Result := Str;
end;
That will get any spaces before or after the text, and return only the text.
Jake