Documentation index for AI agents (llms.txt) A Markdown version of every page is available: request the page's source under /docs/, follow the "alternate" link in this page's head, or start from /llms.txt.
Visual Script logo Manual

Length#

Strings / Length

  • Can Read

  • Cannot Write

Description#

The amount of characters a text has

Parameters#

Name Description
Text The text whose characters are counted

Code#

using System;
using UnityEngine;
using VisualScript.Icons;

namespace VisualScript.Runtime
{
    [Get]

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

    [Description("The amount of characters a text has")]
    [Image(typeof(IconString), ColorTheme.Type.Yellow, typeof(BadgeHash))]

    [Parameter("Text", "The text whose characters are counted")]

    [Keywords("String", "Count", "Size", "Characters", "Amount")]

    [Serializable]
    public class TypeNumberStringLength : TypeNumber
    {
        [SerializeField] private GetString m_Text = new GetString();

        public override double GetPreview(GameObject source) => this.m_Text.GetPreview(source)?.Length ?? 0;

        public override double Get(Args args)
        {
            return this.m_Text.Get(args)?.Length ?? 0;
        }

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

        protected override SubscriptionMode Subscription => SubscriptionMode.OnChange;
    }
}
Visual Script logoVisual Script © Catsoft Works 2026. All rights reserved.