Jump to content

Recommended Posts

Posted

Hi,

I'm using Jaspersoft Studio 6.0, and have a field that contains an email address.  I'd like to simply display the username, rather than the full email address.  How can I strip everything from the @ to the end, so that I'm left with only the username?

 

I assume I can do this with an expression in the "Text" properties for the field, but don't know what the expression would be.

 

Any help would be appreciated!

 

 

        Doug

  • Replies 4
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted

Hi Doug,

It should be possible to do by using java split() method. Something like this:

$F{myEmailAddress}.split("@")[0]

This method splits a string into array of strings. The expression above returns the first part of the string where "@" is a separator, which in your case should return username.

 

- Stas

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...