We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpSyntax Questions › String[] to String
Page Index Toggle Pages: 1
String[] to String (Read 315 times)
String[] to String
Aug 19th, 2009, 11:13am
 
Hi, this is sort of related to the other post I made titled "wrapping text" about justifying text.

If I have a String[] containing all the words and spacing and punctuation of a sentence, how do I convert that into a String that text() can print to the screen?
Re: String[] to String
Reply #1 - Aug 19th, 2009, 11:57am
 
You can do something like:
Code:
StringBuilder sentence = new StringBuilder();
for (int i = 0; i < strArray.lenght; i++)
{
sentence.append(strArray[i]);
}

and use sentence.toString().
Page Index Toggle Pages: 1