Hi everyone,
I have a text for full name which needs to be split into first name and last name.
Last (split(“John, Smith”;,)) would return “Smith”
but
Last (split(“John Smith”; " ")) or Last (split(“John, Smith”; )) does not return “Smith” *note separator is a space here.
Any suggestions? The separator in our source database is actual a space. Or any other way to resolve this?
Thanks,
David
samliew
2
Welcome to the Make community!
You can use the built-in function split
. You need to include both the comma and the space in the delimiter parameter.
e.g.:
{{ first(split("John, Smith"; ", ")) }}
{{ last(split("John, Smith"; ", ")) }}
Output:

For more information, see the function documentation in the Help Center and do the tutorials in the Make Academy.
Hope this helps! Let me know if there are any further questions or issues.
— @samliew
P.S.: Investing some effort into the Make Academy will save you lots of time and frustration using Make.
Thanks heaps. However, my data source is “John Smith” which does not include comma. How to split this this data source?
samliew
4
Welcome to the Make community!
You can use the built-in function split
. You need to use a space in the delimiter parameter, or use the special variable space
.
e.g.:
{{ first(split("John, Smith"; " ")) }}
{{ last(split("John, Smith"; " ")) }}
or,
{{ first(split("John, Smith"; space)) }}
{{ last(split("John, Smith"; space)) }}
(select space from the variables panel, not type it in)
For more information, see the function documentation in the Help Center and do the tutorials in the Make Academy.
Hope this helps! Let me know if there are any further questions or issues.
— @samliew
P.S.: Investing some effort into the Make Academy will save you lots of time and frustration using Make.