Results 1 to 7 of 7
- 06-27-2011, 05:15 PM #1
I have a little bit of problems with the .split() funtion.
To make things short, I have this lines with words like: A.HelloWorld.D
Now there are also words that have: A.HelloWorld.
What I would like is that when there is nothing after the second dot (.) that the program will print a " ". But I don't know how to do that?
Becose I also would like to do something with it outside the if else part.
- 06-27-2011, 05:29 PM #2
- 06-27-2011, 05:48 PM #3
- Join Date
- Sep 2008
- Voorschoten, the Netherlands
- Blog Entries
- Rep Power
There's also a two argument split( ... ) method (it's API doc description is below the one argument split( ... ) method). It can do the job ...
JosWhen people rob a bank they get a penalty; when banks rob people they get a bonus.
- 06-27-2011, 06:17 PM #4
I found the solution!
Thanks for the help. :-)
Last edited by Lund01; 06-27-2011 at 08:08 PM.
- 06-28-2011, 05:37 AM #5
- 06-28-2011, 11:28 AM #6
I needed a -1 behind it.
Like .split("\\.", -1)
And then he also sees the 'blank' spaces.
- 06-28-2011, 04:24 PM #7
- By jeff_limsy in forum New To JavaReplies: 3Last Post: 12-29-2010, 10:23 AM
- By danilson in forum New To JavaReplies: 7Last Post: 11-19-2010, 05:08 PM
- By Java Tip in forum java.langReplies: 4Last Post: 04-17-2009, 09:27 PM
- By JavaBean in forum Java TipReplies: 0Last Post: 10-04-2007, 10:32 PM