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.
IndexSuggestions & BugsWebsite,  Documentation,  Book Bugs › typo in online doc for shorten()
Page Index Toggle Pages: 1
typo in online doc for shorten() (Read 787 times)
typo in online doc for shorten()
Nov 25th, 2007, 7:08am
 
Example code does not show proper result for call to shorten():

String[] sa1 = { "OH ", "NY ", "CA "};
String[] sa2 = shorten(sa1);
println(sa1);  // Prints OH, NY, CA

should say:
String[] sa1 = { "OH ", "NY ", "CA "};
String[] sa2 = shorten(sa1);
println(sa2);  // Prints OH, NY

which would better illustrate what shorten() does.
Re: typo in online doc for shorten()
Reply #1 - Nov 25th, 2007, 6:43pm
 
I changed it to this:

String[] sa1 = { "OH ", "NY ", "CA "};
String[] sa2 = shorten(sa1);
println(sa1);  // sa1 still contains OH, NY, CA
println(sa2);  // sa2 now contains OH, NY

It's more clear (as you suggested) and also shows there is no change to the first array.

Thank you!
Page Index Toggle Pages: 1