String Length


Node Information
Gets the length of the specified string, counting all the characters, it starts from 0.
General Information
• This node doesn't have other available options.
Visual
Visual

Ports
Text Type DataType Accepts IsList CustomAcception
Text IN String ONE FALSE FALSE
Length OUT Int32 MULTIPLE FALSE FALSE

Source
namespace Korduene.KGraph.Nodes.String
{
    [IsNode("Length")]
    public class StringLength : Node
    {
        Port a = new Port(PortType.IN, typeof(string), AcceptsLinks.ONE, "Text");
        Port length = new Port(PortType.OUT, typeof(int), AcceptsLinks.MULTIPLE, "Length");
        public string String
        {
            set { a.Value = value; }
            get { return GetRuntimeValue(a); }
        }
        public StringLength()
        {
            this.Name = "String Length";
            AddPort(a);
            AddPort(length);
            length.Instructions = "init";
            Information = "Gets the length of the specified string, counting all the characters, it starts from 0.";
        }
        public override void UpdateResults()
        {
            length.Instructions = "(" + GetValue(a) + ").Length";
        }
    }
}