asterixx82 Posted June 30, 2010 Share Posted June 30, 2010 Hi guys,the method "split " in iReport exist?I try this.MyData=1547,98MyData.toString().length()--------------> OK = 7(MyData.toString().split(",")[0]).lenght()---------> NOT OK = " 7 "(MyData.toString().split(",")[1]).lenght()---------> NOT OK ERROR MESSAGE THAT "ARRAY INDEX......." I hope that result was = "4" Bye Thanks Code:($F{IMPSTRAOR}!=null)?Character.toString((" "+$F{IMPSTRAOR}.toString()+" ").substring((($F{IMPSTRAOR}.toString().split(",",2))[0]).length()).charAt(8)):"" Link to comment Share on other sites More sharing options...
slow Posted June 30, 2010 Share Posted June 30, 2010 the correct question is"the method "split " in JAVA exist?" use this:MyData.substring(0,MyData.indexOf(',')).length() _________________________________________if it works... give me KARMA points please! : ) _________________________________________listening: Underworld - Beautiful Burnout (Mark Knight remix) Link to comment Share on other sites More sharing options...
asterixx82 Posted July 1, 2010 Author Share Posted July 1, 2010 Hi slow,the method "split " in JAVA exist but in IReport don't functionThe function "indexOf " it's Ok .Now I implement one or two call at this method for arrive at my result. Thanks for your help!!! Bye Bye Link to comment Share on other sites More sharing options...
slow Posted July 1, 2010 Share Posted July 1, 2010 sei italiano... :) ciao!the split method works fine if you use it properly! :)try this:MyData.split("\\.")[0].length()the argument of split method is a regular expression...MyData.toString return a string rapresentation of the BigDecimal with '.' decimal separator, so you must use the regex '\\."ricordati i punti karma! :)_________________________________________if it works... give me KARMA points please! : ) _________________________________________listening: CSI - Io Sto Bene Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now