• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

iReport and using split array elements

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Saul Davis
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Goodbye moon men. Hello tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!