Saul Davis

Greenhorn
+ Follow
since Jul 06, 2010
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Saul Davis

Well this isn't a very good thread, of course after posting... I figured it out!


new String("102,545,365").split(",")[0]

which returns: 102
This is more of a general java question, but I'm using it within iReport.

How can I get the element of an array that contains items from the split() method; in one line?

So i need to:
split a CSV string
get a specific element from the array that the split command will return

-- all in one line since iReport is limited to one line expressions

pseudojava: (split({"element 1","element 3","element 4"}, "")).get(0)

Thanks in advance, I just can't seem to figure it out.
Thanks for sharing the solution... all I needed what the "!"