Skip to content

Commit

Permalink
Fix iterating over string example
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 520415499
Change-Id: I9e0ab2dffde394ee485002b9bd9cbfd63ffc1877
  • Loading branch information
Googler authored and copybara-github committed Mar 29, 2023
1 parent 4097d9c commit 57426bc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/net/starlark/java/eval/StringModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
+ "Strings are not directly iterable, use the <code>.elems()</code> "
+ "method to iterate over their characters. Examples:<br>"
+ "<pre class=\"language-python\">\"bc\" in \"abcd\" # evaluates to True\n"
+ "x = [s for s.elems() in \"abc\"] # x == [\"a\", \"b\", \"c\"]</pre>\n"
+ "x = [c for c in \"abc\".elems()] # x == [\"a\", \"b\", \"c\"]</pre>\n"
+ "Implicit concatenation of strings is not allowed; use the <code>+</code> "
+ "operator instead. Comparison operators perform a lexicographical comparison; "
+ "use <code>==</code> to test for equality.")
Expand Down

0 comments on commit 57426bc

Please sign in to comment.