TrimAll ( LeftWords ( field_you_want_cleansed ; 999999 ) ; 0 ; 0 )
This will remove extra spaces typed between words and extra returns typed after the last word.
Be the first to rate this function Log in to vote
Dr_John - Show more from this author
none |
Function definition: (Copy & paste into FileMaker's Edit Custom Function window)
Use this as an auto enter calc in any text field that might have extra spaces or returns at the end.
The Sample Input field is trimmed (thanks Brian), so you don't see what I typed in that field but it had extra spaces between words and extra returns at the end. Takes out extra spaces between words, leaving one space each, and any extra returns at the end. But Not extra returns in between word which hopefully some could add to this.
Comments
Emmeuno Jul 30, 2019 |
||
Sorry, i don't understand how use it. Can you explain, please? Regards | ||
Dr_John, none Jul 30, 2019 |
||
You can't tell what it does from the input field on the site, but if someone types text with extra spaces in between the words and/or extra returns after, like is often done, it will reduce the spaces to just one, and clear out the returns at the end. It's good for things like names and addresses in labels. | ||
Emmeuno Jul 31, 2019 |
||
The purpose is clear but I don't know how to apply it. I used a Surname field, created a custom function called Check and with Field as a parameter. The Surname field has a validation via "Check Surname. At the exit of the field I have an alert message for invalid characters entered. | ||
Dr_John, none Jul 31, 2019 |
||
in a regular field put the function I wrote in the options/auto enter/calculated value, specify, put the name of your text field where it says "field you want cleansed" uncheck do not replace existing value. |
||
Emmeuno Jul 31, 2019 |
||
Thanks, it works perfectly. Sometimes the difficulty lies in knowing where to write the suggested functions. Regards | ||
André Nov 12, 2020 |
||
Great function, but I noticed that things like period, question mark etc at the end of a sentence are also removed. | ||
Dr_John, none Nov 12, 2020 |
||
It's for name fields basically. | ||
André Nov 12, 2020 |
||
Great function, but I noticed that things like period, question mark etc at the end of a sentence are also removed. | ||
André Nov 12, 2020 |
||
I added the function to the text field in my story development app, but it will not work now because of this. That's a pity, because it would be a great addition. Is there a way to fix this? | ||
Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.