Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #7363
| From | GHansen@hotmail.com (Gunter Hansen) |
|---|---|
| Newsgroups | comp.lang.java.programmer |
| Subject | How to join a range of array string slots with blank delimiters? Almost opposite of string.split()? |
| Followup-To | comp.lang.java.programmer |
| Date | 2011-08-25 05:27 +0000 |
| Message-ID | <4e55dd30$0$7613$9b4e6d93@newsspool1.arcor-online.net> (permalink) |
| Organization | Arcor |
Followups directed to: comp.lang.java.programmer
Assume I split a text line with a command like:
String[] part = line.split("\\s+");
Ok, fine, but how is the opposite command?
Keep in mind that the delimiter between the joined slots of the target string should be one blank.
Moreover: Can I join e.g. only slots [3],...,[MAX]?
So I need a command similar to:
String joined = part[3,MAX].join(' ');
How ca I achieve this?
If this is not possible directly then maxbe with a work around?
Gunther
Back to comp.lang.java.programmer | Previous | Next — Next in thread | Find similar
How to join a range of array string slots with blank delimiters? Almost opposite of string.split()? GHansen@hotmail.com (Gunter Hansen) - 2011-08-25 05:27 +0000
Re: How to join a range of array string slots with blank delimiters? Almost opposite of string.split()? Peter Duniho <NpOeStPeAdM@NnOwSlPiAnMk.com> - 2011-08-24 22:49 -0700
回复:Re: How to join a range of array string slots with blank delimiters? Almost opposite of string.split()? Yuxuan Wang <crnlmcn@gmail.com> - 2011-08-24 23:42 -0700
Re: How to join a range of array string slots with blank delimiters? Almost opposite of string.split()? Arne Vajhøj <arne@vajhoej.dk> - 2011-08-25 22:31 -0400
Re: How to join a range of array string slots with blank delimiters? Almost opposite of string.split()? Peter Duniho <NpOeStPeAdM@NnOwSlPiAnMk.com> - 2011-08-25 20:15 -0700
Re: How to join a range of array string slots with blank delimiters? Almost opposite of string.split()? Roedy Green <see_website@mindprod.com.invalid> - 2011-08-25 13:05 -0700
Re: How to join a range of array string slots with blank delimiters? Almost opposite of string.split()? Roedy Green <see_website@mindprod.com.invalid> - 2011-08-31 23:41 -0700
Re: How to join a range of array string slots with blank delimiters? Almost opposite of string.split()? Arne Vajhøj <arne@vajhoej.dk> - 2011-08-25 22:28 -0400
csiph-web