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 › String: Documentation/Example Error
Page Index Toggle Pages: 1
String: Documentation/Example Error (Read 606 times)
String: Documentation/Example Error
Jul 18th, 2007, 8:54pm
 
Hiya, there's a slight error on this page

http://processing.org/reference/String.html

"Because a String is defined within quotes, including quotes in a String requires the (backslash) character to be used (see the second example above)."

The second example, however, completely lacks any backslashes!

it reads as follows:

// Use a backslash to include quotes in a String
String quoted = "This one has "quotes"";
println(quoted);  // This one has "quotes"

when it should look like:

// Use a backslash to include quotes in a String
String quoted = "This one has \"quotes\"";
println(quoted);  // This one has "quotes"
Page Index Toggle Pages: 1