Hi,
Take this sentence for example. Would it be possible to have a function so that it extracts all the spaces leaving this: 'Takethissentenceforexample' ?
Thanks.
Also one more question
I have a listbox with some products. I have programmed the program to add 'clicked' item from listbox1, to listbox2 when the button 'Add' is clicked, kinda like a shopping basket. Ie. highlighted item is added to listbox2 when 'Add' is clicked.
Now, the thing is, what happens when I dont highlight an Item and just click Add? Well I tried it, and it added 'h9E' to listbox2. Have no idea what this means. Anyway to fix this bug?
Thanks
Yes, if I were you, I would start and learn some regular expressions, you have no idea how useful these can be later in your programming life.
RegEx in Delphi - Regular Expression Libraries for Delphi
To eliminate spaces, just use stringreplace(string,' ','', [rfReplaceAll]).
String handling routines - Delphi Programming
Thanks to both of you.
Thanks BlaineSch, but Im still a noob. Apparently that regex thing is pretty complex? But some people say its really useful, so Ill read up on it. Is this regex thing kinda like only letting the person enter a Letter for the first character for the postcode field? and a number for the 3rd etc? Thanks
And thanks WingPanther
RegEx allows you to do a wide variety of string validation and substitutions. It is very powerful, and not that hard to learn. Depending on the version of Delphi you have, you may or may not have access to it without downloading and installing a component, however.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks