I tried my best to find another thread on this topic but I just couldn’t find any. I’m wondering if there is a way to use :truncate on a text field to extract the first part of a name up to the first space. The assumption I’m making is that my users are writing their full name in the form of “first name last name” of course.
I’ve been trying to use the :truncate function and also the extract and replace. But I can’t quite do it. I’m guessing it’s not possible.
But if anyone has succeeded on this, could you please share how you did it exactly so I could try.
Is there a reason they need to enter it in a single field or can you have them do first name field and last name field? Then you could have a full name field that equals those two values. That might be easier!
The gist is that each bracketed set (in above example, this means the bracketed set (.) and (\s.) is capturing text as a group that can later be referenced by a $n where ‘n’ is the number of the bracketed group in the sequence you’re referencing. Meaning that, again, if there are two bracketed groups in ilham’s example, it is the second group you want to reference - the (\s.*) - making the n a 2. So, $2.
This regex feature that Emmanuel enabled is SOOOO powerful in respect of the find and replace.
To give anyone reading this thread an alternative to regex (this is probably the actual simplest method, but it didn’t exist back when this thread was doing its thing), use Bubble’s :split by operator, split by a space character, and get the first item (or get the last item, if you want the last name).