Hello everyone, I am getting trouble with separating user name. I store full user name in database, and i want to get only first name from it in expression. How should i do?
Hello Phone,
You got several ways to do this. I would suggest you to substr() the string since the first char to the index() where is the first " ". Other way is to use the String_Split and get the first value of the list. Other way to do it is with SQL using some functions and an advaced query!
Cheers!
Phone wrote:
Hi Phone,
Do you have any delimiters in full username.
can you explain with more details?
Ellakkiya Selvadurai wrote:
For example, the name is "Kyaw Naing Oo" and I want only "Kyaw"
Hi phone,
You can go with Tiago Gomes approach
Use String_split action
Drag an assigment
Like Tiago already said, you can use Substr + IndexOf, or alternatively, you could use String_Split (from the Text extension). However, depending on where a person comes from, there may be no easy way to determine what part is the first name, and what part the last (take e.g. a Dutch name like "Harm Jan de Vries", where it splits in the middle (and, oddly enough, a seperate last name should be spelled with a capital ("De Vries"), but not if initials or first name come before).
Hi,
You can use String_Split from the Text extension, and select the first result of the output list.
You can use the space (" ") as your delimiter.
You can use the below method to get the first name
SyntaxEditor Code Snippet
Substr(NAME,0,Index(NAME," "))
you find the position of the space and use substr function to fetch the first word.
Hope this will helpful.
:)
Ok guys, I'm going to close this topic. People keep answering the same over and over again, that's not very useful. To all: please read the previous replies first, before replying!