Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #7363

How to join a range of array string slots with blank delimiters? Almost opposite of string.split()?

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!newsfeed.utanet.at!newsfeed01.chello.at!newsfeed.arcor.de!newsspool4.arcor-online.net!news.arcor.de.POSTED!not-for-mail
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 25 Aug 2011 05:27:12 GMT
Lines 19
Message-ID <4e55dd30$0$7613$9b4e6d93@newsspool1.arcor-online.net> (permalink)
Organization Arcor
NNTP-Posting-Date 25 Aug 2011 07:27:12 CEST
NNTP-Posting-Host 8dc36fe0.newsspool1.arcor-online.net
X-Trace DXC=GFenF?nFCM6L2C_`koXfC5ic==]BZ:af>4Fo<]lROoR1<`=YMgDjhg2=XASS;kQnA?QL4QcO2CM419AW^;nKDM<?_n4E:CYZ`m6eSi62BR6A96
X-Complaints-To usenet-abuse@arcor.de
Xref x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:7363

Followups directed to: comp.lang.java.programmer

Show key headers only | View raw


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 | NextNext in thread | Find similar


Thread

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