Trimming a space in a Post
Options
![Matt](https://us.v-cdn.net/6037124/uploads/userpics/S9IH7C4NYFWD/nWSW4BEIKQEDA.jpg)
Matt
Member ✭
One field in my table needs to ensure there are no spaces. It will be used as a public facing URL appended to a page such as:
website.com/[field_input]
...where [field_input] is the displayed data from the specific field of the table. When a POST call is made, I need to ensure there are no spaces at all - I've figured out how to ensure all characters are lowercase within the Function stack.
website.com/[field_input]
...where [field_input] is the displayed data from the specific field of the table. When a POST call is made, I need to ensure there are no spaces at all - I've figured out how to ensure all characters are lowercase within the Function stack.
Comments
-
you have a trim function for text which removes first and last spaces, not sure if this helps...
otherwise if you cannot have any spaces you can split text into array with " " as a separator and then join it again without spaces -
There are also trim filters that you can take advantage of:
[CleanShot 2021-11-15 at 17.45.24.png] -
These only appear to work for the beginning or end, based on my attempts at using them. I'd need to ensure there are no spaces between characters as well. The goal here is that it would be intentionally a page URL format.
-
why wont you try URL encoding filter?
otherwise as suggested before split array with space " " separator and join all elements as 1 string -
Trimming is always going to be on the ends. Perhaps, look at url_encode per suggestion. Also, there is a replace filter that you can use to replace spaces with nothing.
-
Thanks guys. I'll play around with these options and report back later.
Categories
- All Categories
- 53 ? Announcements
- 47 ? Releases
- 37 ? Welcome
- 983 ? Help! I'm a Noob
- 125 ? No-Code Front-Ends
- 633 ? Working with APIs
- 439 ? Transforming data
- 126 ? Connect Xano to ...
- 50 ?? Find an Expert
- 348 ❓Other questions
- 35 ? Security
- 22 ✂️ Snippets
- 19 ? Showcase
- 7 ?️ Xano Chatter
- 62 ? Video Tutorials
- 171 ? Request a feature
- 229 ? Report a Bug
- 19 ? Templates & Extensions
- 7 ? Feedback