---
tags:
    - "String"
    - "Letters"
    - "Char"
    - "Each"
    - "Iterate"
    - "Loop"
---

# Characters

[Strings](index.md) / **Characters**

<div class="grid cards" markdown>

* :green_circle: Can Read

* :red_circle: Cannot Write

</div>

## Description

The collection made of every single character of a text, in order

## Parameters

| Name | Description |
| :--- | :---------- |
| Text | The text that is broken into characters |

## Code

```cs
using System;
using System.Collections.Generic;
using UnityEngine;
using VisualScript.Icons;

namespace VisualScript.Runtime
{
    [Get]

    [Title("Characters")]
    [Category("Strings/Characters")]

    [Description("The collection made of every single character of a text, in order")]
    [Image(typeof(IconString), ColorTheme.Type.Yellow, typeof(BadgeString))]

    [Parameter("Text", "The text that is broken into characters")]

    [Keywords("String", "Letters", "Char", "Each", "Iterate", "Loop")]

    [Serializable]
    public class TypeCollectionStringCharacters : TTypeCollection<string>
    {
        // EXPOSED MEMBERS: -----------------------------------------------------------------------

        [SerializeField] private GetString m_Text = new GetString();

        // PUBLIC METHODS: ------------------------------------------------------------------------

        public override string ToString()
        {
            return $"Characters of {this.m_Text}";
        }

        // PROTECTED METHODS: ---------------------------------------------------------------------

        protected override SubscriptionMode Subscription => SubscriptionMode.OnChange;

        protected override void OnCapture(Args args, List<string> items)
        {
            string text = this.m_Text.Get(args);
            if (string.IsNullOrEmpty(text)) return;

            foreach (char character in text)
            {
                items.Add(character.ToString());
            }
        }
    }
}
```

