String Theory Question

String theory Question
I want to remove the last one or 2 words from a string.
eg
‘Mary and John Road East’
I want to remove ‘Road East’ in this case

Whats the best way to do this?

whew - lots of ways, but checkout SPLIT and also SPLITINTOWORDS.

https://www.capesoft.com/docs/StringTheory3/StringTheory.htm#stSplit
https://www.capesoft.com/docs/StringTheory3/StringTheory.htm#SplitIntoWords

For address verification, and address normalisation in general, I recommend using the NetTalk NetMaps methods;
https://www.capesoft.com/docs/NetTalk11/NetTalkMaps.Htm#GetAutoComplete

Cheers
Bruce

Cheers
Bruce

Hi,
As Bruce says Clarion has an abundance of String examination options.

It’s worth looking up, ‘string slicing’, SUB(), STRPOS(), LEFT(), RIGHT(), INSTRING(), in the help pages. CLIP() may also be useful at some point, if you wish to start looking from the right.
If you have a standard format to these fields ISLOWER() and ISUPPER() can help identify where words start.
Since you have spaces that divide words if there is a uniform structure (3rd space?) you can hunt these down, and then slice off what you want.

I often chop out first names except for the first letter (i.e. Initial) for screens where space is limited. Also when entry fields have the CAP attribute, I check for names like ‘Mc’, Mac’, ‘O’ so I can reformat with the normal format ‘McDonald’ rather than ‘Mcdonald’ to store in the database.

Regards, Jim