You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: libscript/src/char.lcb
+33-9Lines changed: 33 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -535,17 +535,15 @@ Summary: Repeat over the chars of a string
535
535
Iterand: A string container.
536
536
537
537
Example:
538
-
variable tString as String
539
-
put "stressed" into tString
540
-
541
-
variable tReversed as String
542
538
variable tChar as String
543
-
put "" into tReversed
544
-
repeat for each char tChar in tString
545
-
put tChar before tReversed
539
+
variable tSpaceCount as Number
540
+
repeat for each char tChar in \
541
+
"the quick brown fox jumps over the lazy dog"
542
+
if tChar is " " then
543
+
add 1 to tSpaceCount
544
+
end if
546
545
end repeat
547
-
548
-
// tReversed is "desserts"
546
+
expect that tSpaceCount is 8
549
547
550
548
Description:
551
549
Use repeat for each to perform an operation on each char of a string. On each iteration, the <Iterand> will contain the next char of the string being iterated over.
0 commit comments