My username is raviprakash@gmail.com, how do i remove @gmail.com from home page

0
My username is raviprakash@gmail.com, how do i remove @gmail.com from home page using javascript, microflow, just need to display raviprakash not @gmail.com at home page
asked
2 answers
1

You could use a combination of the substring function and the indexof function to remove everything after the @. 

string.substring(indexStart, indexEnd)
string.indexOf(searchvalue, start)

So if you use the result of the indexOf the @, you should be able to get a substring with indexStart 0 and indexEnd the result of the indexOf.

Alternatively, you could just use the functions “substring” and “find” that are already available in Mendix, so you don't have to make custom javascript actions.

answered
1

You can use a regular expression, so if you use replaceFirst, the following should work.
 

replaceFirst('raviprakash@gmail.com', '@.*$', '')

 

answered