String.Codepoints

From Xojo Documentation

Revision as of 10:57, 16 September 2021 by Gperlman (talk | contribs) (Created page with "{{MethodBox | name = Codepoints | ownertype = class | scope = public | parameters = | owner = String | returntype = Iterable }} {{Description | text = Returns an iter...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Method

String.Codepoints() As Iterable

Supported for all project types and targets.

Returns an iterator that returns UInt32 values for each Unicode scalar value that comprises the string.

Sample Code

Look for Unicode 65:

Var myString As String = "Once Upon A Time"
For Each codePoint As UInt32 In myString.Codepoints
If codePoint = 65 Then
// It is "A"
End If
Next