String.Characters

From Xojo Documentation

Revision as of 06:04, 5 October 2020 by RobinLM (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Method

String.Characters() As Iterable

New in 2020r1

Supported for all project types and targets.

Allows you to iterate through the characters in a string.

Examples

This example is a function that takes a string (source) then returns the number of asterisks in it:

Var count As Integer
For Each char As String In source.Characters
if char = "*" then count = count + 1
Next
Return count