Prechádzať zdrojové kódy

for statement iterating through String characters

(cherry picked from commit f7cfd22af4a9bd22d7d4c85236a0882998a4a31f)
Pawel Kowal 8 rokov pred
rodič
commit
5ca1e43cd6
1 zmenil súbory, kde vykonal 3 pridanie a 0 odobranie
  1. 3 0
      reference/gdscript.rst

+ 3 - 0
reference/gdscript.rst

@@ -650,6 +650,9 @@ in the loop variable.
     for i in range(2,8,2):
         statement  # similar to [2, 4, 6] but does not allocate an array
 
+    for c in "Hello":
+        print(c)   # iterate through all characters in a String, print every letter on new line
+
 Classes
 ~~~~~~~